aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-01-21 00:12:25 +0100
committerEgor Tensin <egor@tensin.name>2026-01-21 00:12:25 +0100
commit8cc4ac35cf13cf3c9b9434b3134ebc481edde37a (patch)
tree204894a0df2e9a0e8c5520dd2b7b068a732b2d8f
parentproject.boost: switch from `stage` to `install` (diff)
downloadcmake-common-8cc4ac35cf13cf3c9b9434b3134ebc481edde37a.tar.gz
cmake-common-8cc4ac35cf13cf3c9b9434b3134ebc481edde37a.zip
common.cmake: fix CC_STATIC_RUNTIME w/r/t Boost
Since I've been transitioning to Boost's CMake files, the shortcut where I just specify LIBRARYDIR & USE_STATIC_RUNTIME doesn't seem to work anymore, so we're fighting.
-rw-r--r--common.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/common.cmake b/common.cmake
index 36f232b..39e490d 100644
--- a/common.cmake
+++ b/common.cmake
@@ -68,6 +68,10 @@ if(NOT DEFINED CC_STATIC_RUNTIME)
# Linking to dynamic Boost libs and the static runtime is a no-no:
set(static_runtime_default_value OFF)
endif()
+ if((CMAKE_HOST_LINUX OR CMAKE_HOST_APPLE) AND static_runtime_default_value)
+ message(STATUS "Cannot link to the GNU C Library or BSD libc (which are assumed) statically, going to link dynamically")
+ set(static_runtime_default_value OFF)
+ endif()
option(CC_STATIC_RUNTIME "Link the runtime statically" "${static_runtime_default_value}")
endif()
if(NOT DEFINED CC_STRIP_SYMBOLS)