mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Add some comments
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
This commit is contained in:
parent
6553029e2f
commit
0d2985cacd
@ -9,6 +9,10 @@ include(CheckCXXCompilerFlag)
|
|||||||
## FUNCTIONS ######################################################################################
|
## FUNCTIONS ######################################################################################
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test compiler flags and add them when they are supported
|
||||||
|
#
|
||||||
|
|
||||||
function(add_cxx_compiler_flags var)
|
function(add_cxx_compiler_flags var)
|
||||||
foreach(flag ${ARGN})
|
foreach(flag ${ARGN})
|
||||||
string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" flag_var "CXXFLAG_${flag}")
|
string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" flag_var "CXXFLAG_${flag}")
|
||||||
@ -20,6 +24,11 @@ function(add_cxx_compiler_flags var)
|
|||||||
set(${var} "${${var}}" PARENT_SCOPE)
|
set(${var} "${${var}}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Remove compiler flags
|
||||||
|
#
|
||||||
|
|
||||||
function(remove_any_compiler_flags var)
|
function(remove_any_compiler_flags var)
|
||||||
foreach(flag ${ARGN})
|
foreach(flag ${ARGN})
|
||||||
string(REPLACE "${flag}" "" ${var} "${${var}}")
|
string(REPLACE "${flag}" "" ${var} "${${var}}")
|
||||||
@ -35,6 +44,11 @@ function(remove_compiler_flags)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Save and Restore compiler flags
|
||||||
|
#
|
||||||
|
|
||||||
function(save_compiler_flags)
|
function(save_compiler_flags)
|
||||||
set(CMAKE_CXX_FLAGS_SAVED "${CMAKE_CXX_FLAGS}" CACHE STRING "Saved compiler C++ flags" FORCE)
|
set(CMAKE_CXX_FLAGS_SAVED "${CMAKE_CXX_FLAGS}" CACHE STRING "Saved compiler C++ flags" FORCE)
|
||||||
endfunction()
|
endfunction()
|
||||||
@ -44,6 +58,7 @@ function(restore_compiler_flags)
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE)
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
## COMPILER FLAGS #################################################################################
|
## COMPILER FLAGS #################################################################################
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user