diff --git a/CMake/AddCXXCompilerFlag.cmake b/CMake/AddCXXCompilerFlag.cmake index ef3dfaaf..6fb615a1 100644 --- a/CMake/AddCXXCompilerFlag.cmake +++ b/CMake/AddCXXCompilerFlag.cmake @@ -29,20 +29,20 @@ endfunction(mangle_compiler_flag) function(add_cxx_compiler_flag FLAG) string(REPLACE "-Wno-" "-W" MAIN_FLAG ${FLAG}) - mangle_compiler_flag("${MAIN_FLAG}" MANGLED_FLAG) + mangle_compiler_flag("${MAIN_FLAG}" MANGLED_FLAG_NAME) if (DEFINED CMAKE_REQUIRED_FLAGS) set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") else() set(CMAKE_REQUIRED_FLAGS "${FLAG}") endif() - check_cxx_compiler_flag("${MAIN_FLAG}" ${MANGLED_FLAG}) + check_cxx_compiler_flag("${MAIN_FLAG}" ${MANGLED_FLAG_NAME}) if (DEFINED OLD_CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}") else() unset(CMAKE_REQUIRED_FLAGS) endif() - if (MANGLED_FLAG) + if (${MANGLED_FLAG_NAME}) set(VARIANT ${ARGV1}) if (ARGV1) string(TOUPPER "_${VARIANT}" VARIANT) @@ -53,12 +53,12 @@ endfunction() function(add_required_cxx_compiler_flag FLAG) string(REPLACE "-Wno-" "-W" MAIN_FLAG ${FLAG}) - mangle_compiler_flag("${MAIN_FLAG}" MANGLED_FLAG) + mangle_compiler_flag("${MAIN_FLAG}" MANGLED_FLAG_NAME) set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") - check_cxx_compiler_flag("${MAIN_FLAG}" ${MANGLED_FLAG}) + check_cxx_compiler_flag("${MAIN_FLAG}" ${MANGLED_FLAG_NAME}) set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}") - if (MANGLED_FLAG) + if (${MANGLED_FLAG_NAME}) set(VARIANT ${ARGV1}) if (ARGV1) string(TOUPPER "_${VARIANT}" VARIANT)