From d1227466fca7bb1d518e15694714837961d6423e Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 22 Apr 2019 04:17:07 +0300 Subject: [PATCH] Fix add_cxx_compiler_flag. GitOrigin-RevId: fdca6decb5951470e51ecc46cc797877c19a2566 --- CMake/AddCXXCompilerFlag.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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)