Commit fbcc262e authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #590

Support for static runtime
parents 7755e88b 974515f2
...@@ -15,6 +15,35 @@ if(WIN32 AND NOT CAF_BUILD_STATIC_ONLY) ...@@ -15,6 +15,35 @@ if(WIN32 AND NOT CAF_BUILD_STATIC_ONLY)
set(CAF_BUILD_STATIC_ONLY yes) set(CAF_BUILD_STATIC_ONLY yes)
endif() endif()
if(CAF_BUILD_STATIC_RUNTIME)
set(flags_configs
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL
)
foreach(flags ${flags_configs})
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(NOT ${flags} MATCHES "-static-libstdc\\+\\+")
set(${flags} "${${flags}} -static-libstdc++")
endif()
if(NOT ${flags} MATCHES "-static-libgcc")
set(${flags} "${${flags}} -static-libgcc")
endif()
elseif(MSVC)
if(${flags} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flags} "${${flags}}")
endif()
endif()
endforeach()
endif()
# add helper target that simplifies re-running configure # add helper target that simplifies re-running configure
add_custom_target(configure COMMAND ${CMAKE_CURRENT_BINARY_DIR}/config.status) add_custom_target(configure COMMAND ${CMAKE_CURRENT_BINARY_DIR}/config.status)
...@@ -719,6 +748,7 @@ if(NOT CAF_NO_SUMMARY) ...@@ -719,6 +748,7 @@ if(NOT CAF_NO_SUMMARY)
"\nBuild type: ${CMAKE_BUILD_TYPE}" "\nBuild type: ${CMAKE_BUILD_TYPE}"
"\nBuild static: ${CAF_BUILD_STATIC}" "\nBuild static: ${CAF_BUILD_STATIC}"
"\nBuild static only: ${CAF_BUILD_STATIC_ONLY}" "\nBuild static only: ${CAF_BUILD_STATIC_ONLY}"
"\nBuild static runtime: ${CAF_BUILD_STATIC_RUNTIME}"
"\nRuntime checks: ${CAF_ENABLE_RUNTIME_CHECKS}" "\nRuntime checks: ${CAF_ENABLE_RUNTIME_CHECKS}"
"\nLog level: ${LOG_LEVEL_STR}" "\nLog level: ${LOG_LEVEL_STR}"
"\nWith mem. mgmt.: ${CAF_BUILD_MEM_MANAGEMENT}" "\nWith mem. mgmt.: ${CAF_BUILD_MEM_MANAGEMENT}"
......
...@@ -47,6 +47,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -47,6 +47,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--dual-build build using both gcc and clang --dual-build build using both gcc and clang
--build-static build as static and shared library --build-static build as static and shared library
--build-static-only build as static library only --build-static-only build as static library only
--static-runtime build with static C++ runtime
--more-warnings enables most warnings --more-warnings enables most warnings
--no-compiler-check disable compiler version check --no-compiler-check disable compiler version check
--no-auto-libc++ do not automatically enable libc++ for Clang --no-auto-libc++ do not automatically enable libc++ for Clang
...@@ -353,6 +354,9 @@ while [ $# -ne 0 ]; do ...@@ -353,6 +354,9 @@ while [ $# -ne 0 ]; do
--build-static-only) --build-static-only)
append_cache_entry CAF_BUILD_STATIC_ONLY BOOL yes append_cache_entry CAF_BUILD_STATIC_ONLY BOOL yes
;; ;;
--static-runtime)
append_cache_entry CAF_BUILD_STATIC_RUNTIME BOOL yes
;;
--with-javac=*) --with-javac=*)
append_cache_entry CAF_JAVA_COMPILER FILEPATH "$optarg" append_cache_entry CAF_JAVA_COMPILER FILEPATH "$optarg"
;; ;;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment