Changed: Allow to use static C++ runtimes
--HG-- branch : develop
This commit is contained in:
parent
4444e93bf7
commit
f3753a08a8
1 changed files with 13 additions and 2 deletions
|
@ -238,6 +238,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
|||
OPTION(WITH_EXTERNAL "With provided external." OFF)
|
||||
ENDIF()
|
||||
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
|
||||
OPTION(WITH_STATIC_RUNTIMES "Use only static C++ runtimes" OFF)
|
||||
IF(UNIX AND NOT APPLE)
|
||||
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
|
||||
ELSE()
|
||||
|
@ -636,8 +637,14 @@ MACRO(NL_SETUP_BUILD)
|
|||
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
|
||||
ENDIF()
|
||||
|
||||
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
|
||||
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
|
||||
IF(WITH_STATIC_RUNTIMES)
|
||||
SET(RUNTIME_FLAG "/MT")
|
||||
ELSE()
|
||||
SET(RUNTIME_FLAG "/MD")
|
||||
ENDIF()
|
||||
|
||||
SET(NL_DEBUG_CFLAGS "/Zi ${RUNTIME_FLAG}d /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
|
||||
SET(NL_RELEASE_CFLAGS "${RUNTIME_FLAG} /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
|
||||
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt ${MSVC_INCREMENTAL_YES_FLAG} ${NL_DEBUG_LINKFLAGS}")
|
||||
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
|
||||
|
||||
|
@ -967,6 +974,10 @@ MACRO(NL_SETUP_BUILD)
|
|||
|
||||
IF(NOT APPLE)
|
||||
ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed")
|
||||
|
||||
IF(WITH_STATIC_RUNTIMES)
|
||||
ADD_PLATFORM_LINKFLAGS("-static-libstdc++")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT APPLE)
|
||||
|
|
Loading…
Reference in a new issue