Windows: cmake: Add CEF_RUNTIME_LIBRARY_FLAG for overriding VS runtime type.

This commit is contained in:
Tobias Taschner 2018-02-22 20:00:09 +00:00 committed by Marshall Greenblatt
parent 39ccd85d77
commit cca0bcc8e0
1 changed files with 7 additions and 2 deletions

View File

@ -350,6 +350,13 @@ if(OS_WINDOWS)
# Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385). # Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use") set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
# Consumers using different runtime types may want to pass different flags
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Optional flag specifying which runtime to use")
if (CEF_RUNTIME_LIBRARY_FLAG)
list(APPEND CEF_COMPILER_FLAGS_DEBUG ${CEF_RUNTIME_LIBRARY_FLAG}d)
list(APPEND CEF_COMPILER_FLAGS_RELEASE ${CEF_RUNTIME_LIBRARY_FLAG})
endif()
# Platform-specific compiler/linker flags. # Platform-specific compiler/linker flags.
set(CEF_LIBTYPE STATIC) set(CEF_LIBTYPE STATIC)
list(APPEND CEF_COMPILER_FLAGS list(APPEND CEF_COMPILER_FLAGS
@ -369,12 +376,10 @@ if(OS_WINDOWS)
${CEF_DEBUG_INFO_FLAG} ${CEF_DEBUG_INFO_FLAG}
) )
list(APPEND CEF_COMPILER_FLAGS_DEBUG list(APPEND CEF_COMPILER_FLAGS_DEBUG
/MTd # Multithreaded debug runtime
/RTC1 # Disable optimizations /RTC1 # Disable optimizations
/Od # Enable basic run-time checks /Od # Enable basic run-time checks
) )
list(APPEND CEF_COMPILER_FLAGS_RELEASE list(APPEND CEF_COMPILER_FLAGS_RELEASE
/MT # Multithreaded release runtime
/O2 # Optimize for maximum speed /O2 # Optimize for maximum speed
/Ob2 # Inline any suitable function /Ob2 # Inline any suitable function
/GF # Enable string pooling /GF # Enable string pooling