summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-04 20:09:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-11-04 20:09:45 (GMT)
commit190fdec8572ad6d2398e06954d4b7bdf0f212929 (patch)
tree6d81bafd7d4c88711e5700cf247f5412437bb3ec /Modules
parent5204329315453687e6d1b0fa4b802871cf4534dd (diff)
parenteaf6f67f67e12c4e137c8e875ac277072bf910b6 (diff)
downloadCMake-190fdec8572ad6d2398e06954d4b7bdf0f212929.zip
CMake-190fdec8572ad6d2398e06954d4b7bdf0f212929.tar.gz
CMake-190fdec8572ad6d2398e06954d4b7bdf0f212929.tar.bz2
Merge topic 'extra-generators-std-flags'
eaf6f67f Code Blocks/Eclipse: Add -std= flag matching. 45a25d63 Code Blocks/Eclipse: Use non-default stdlib includes when specified.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 92b0d1d..064e650 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -26,11 +26,18 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
if (${_lang} STREQUAL "c++")
set(_compilerExecutable "${CMAKE_CXX_COMPILER}")
set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
+
+ if (CMAKE_CXX_FLAGS MATCHES "(-stdlib=[^ ]+)")
+ set(_stdlib "${CMAKE_MATCH_1}")
+ endif ()
+ if (CMAKE_CXX_FLAGS MATCHES "(-std=[^ ]+)")
+ set(_stdver "${CMAKE_MATCH_1}")
+ endif ()
else ()
set(_compilerExecutable "${CMAKE_C_COMPILER}")
set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
endif ()
- execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
+ execute_process(COMMAND ${_compilerExecutable} ${_arg1} ${_stdver} ${_stdlib} -v -E -x ${_lang} -dD dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput
OUTPUT_VARIABLE _gccStdout )