From 716626f2f41f51cda38834e5c9dc691b0c4fd664 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Fri, 4 Jan 2019 20:21:10 -0800 Subject: [PATCH] cmake: Disable unit tests for static builds. (#2775) --static now implies --no-unit-testing. Fixes #2672. --- CMakeLists.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3265830cc..33e06840e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,15 +212,6 @@ if(NOT ENABLE_ASSERTIONS) set(ENABLE_UNIT_TESTING OFF) endif() -# Never build unit tests as static binaries, otherwise we'll end up with -# ~300MB per unit test. -if(ENABLE_UNIT_TESTING) - if(NOT ENABLE_SHARED) - message(WARNING "Disabling static build since unit testing is enabled.") - endif() - set(ENABLE_SHARED ON) -endif() - #-----------------------------------------------------------------------------# # Shared/static libraries # @@ -239,6 +230,13 @@ else() # This is required to force find_package(Boost) to use static libraries. set(Boost_USE_STATIC_LIBS ON) cvc4_set_option(ENABLE_STATIC_BINARY ON) + + # Never build unit tests as static binaries, otherwise we'll end up with + # ~300MB per unit test. + if(ENABLE_UNIT_TESTING) + message(WARNING "Disabling unit tests since static build is enabled.") + set(ENABLE_UNIT_TESTING OFF) + endif() endif() #-----------------------------------------------------------------------------# -- 2.30.2