tvl-depot/third_party/nix/CMakeLists.txt
Luke Granger-Brown 739a45f9e4 chore(3p/nix): use GNUInstallDirs to determine output directory names
This ensures that we install both glog's .a and all the .so files we
generate into a single consistent output lib path (which is, err,
lib64, but whatever).

Change-Id: Ib6ac6eacf5f56e4b719cfb586db731efc122c31b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/544
Reviewed-by: tazjin <mail@tazj.in>
2020-06-21 20:42:28 +00:00

43 lines
1.5 KiB
CMake

# -*- mode: cmake; -*-
cmake_minimum_required(VERSION 3.16)
project(nix CXX)
set(CMAKE_CXX_STANDARD 17)
# Export compile_commands.json which can be used by tools such as
# clangd and clang-tidy.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Provide an output path for pkgconfig.
include(GNUInstallDirs)
# The following lines import CMake-native dependencies which may
# contain useful definitions. Other dependencies are not treated
# specially by CMake and are only linked into the resulting binary.
find_package(BZip2)
find_package(Boost COMPONENTS context) # probably coroutine + ::headers, lets find out
find_package(CURL)
find_package(SQLite3)
find_package(Threads)
find_package(LibLZMA)
# Abseil really doesn't like being precompiled. It is included here as
# an imported CMake project (i.e. it will be built /with/ this
# project).
#
# In development mode, the 'abseil_cpp' folder is symlinked to
# ../abseil_cpp (the relative location in the depot). In derivation
# builds this symlink is automatically replaced with an appropriate
# link to the Abseil sources in the Nix store.
add_subdirectory(abseil_cpp)
# Linking precompiled glog binaries (linked against libstdc++) leads
# to working binaries that do not output log messages. It seems that
# in order to use glog with LLVM & libc++, one needs to make glog a
# part of the local project build.
add_subdirectory(glog)
# generate a configuration file (autoheader-style) to configure
# certain symbols that Nix depends on.
configure_file(config.h.in nix_config.h @ONLY)
add_subdirectory(src)