26 lines
1.4 KiB
Text
26 lines
1.4 KiB
Text
|
Index: Modules/Compiler/GNU.cmake
|
||
|
--- Modules/Compiler/GNU.cmake.orig
|
||
|
+++ Modules/Compiler/GNU.cmake
|
||
|
@@ -100,10 +100,17 @@ macro(__compiler_gnu lang)
|
||
|
|
||
|
# Initial configuration flags.
|
||
|
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
|
||
|
- string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
|
||
|
- string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
|
||
|
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
|
||
|
- string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
|
||
|
+ if(DEFINED ENV{MODCMAKE_PORT_BUILD})
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -DNDEBUG")
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -g -DNDEBUG")
|
||
|
+ else()
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
|
||
|
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
|
||
|
+ endif()
|
||
|
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||
|
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||
|
if(NOT APPLE OR NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4) # work around #4462
|