From 4120eb5f990e4a69991d55d359788109c5c848ef Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 22 Apr 2020 15:06:15 -0400 Subject: [PATCH] [cmake] Add BUILD_SHARED_LIBS option, continue to build static by default --- CMakeLists.txt | 1 + c++/app4triqs/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f5e6780..44d8b6dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,7 @@ endif() set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Global compiler options +option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" FALSE) add_compile_options( $<$:-Og> $<$:-ggdb3> diff --git a/c++/app4triqs/CMakeLists.txt b/c++/app4triqs/CMakeLists.txt index 1818f87a..eecbd50f 100644 --- a/c++/app4triqs/CMakeLists.txt +++ b/c++/app4triqs/CMakeLists.txt @@ -1,5 +1,5 @@ file(GLOB_RECURSE sources *.cpp) -add_library(app4triqs_c STATIC ${sources}) +add_library(app4triqs_c ${sources}) # Link against triqs and enable warnings target_link_libraries(app4triqs_c PUBLIC triqs PRIVATE project_warnings)