From 6246e6d72fc50433e9d69d9b75507c200c196508 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Sat, 14 Jan 2017 08:23:15 -0800 Subject: [PATCH] fix(src/CMakeLists): -DSTATIC=ON option We are still getting a bunch of warnings because of dynamic_library.cpp. I will fix this later. --- src/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6392fdb3a6..2336b7b09c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -365,9 +365,11 @@ add_subdirectory(api) # For some strange reason, it contains a copy of pthread_equal. # Remark: this problem does not happen when we generate the DLL using msys2 on Windows. if (NOT("${CROSS_COMPILE}" MATCHES "ON")) - add_library(leanshared SHARED shared/init.cpp $ ${LEAN_OBJS}) - target_link_libraries(leanshared ${EXTRA_LIBS}) - install(TARGETS leanshared DESTINATION lib) + if ("${STATIC}" MATCHES "OFF") + add_library(leanshared SHARED shared/init.cpp $ ${LEAN_OBJS}) + target_link_libraries(leanshared ${EXTRA_LIBS}) + install(TARGETS leanshared DESTINATION lib) + endif() install(TARGETS leanstatic DESTINATION lib) endif() @@ -393,7 +395,7 @@ add_subdirectory(tests/shell) # The DLL (shared library) is not being generated correctly when we use cross-compilation (i.e., generate the Windows DLL using Linux). # For some strange reason, it contains a copy of pthread_equal. -if (NOT("${CROSS_COMPILE}" MATCHES "ON")) +if (NOT("${CROSS_COMPILE}" MATCHES "ON") AND ("${STATIC}" MATCHES "OFF")) add_subdirectory(tests/shared) endif() add_subdirectory(tests/util/lp)