diff options
author | Brad King <brad.king@kitware.com> | 2014-11-04 20:09:45 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-11-04 20:09:45 (GMT) |
commit | 190fdec8572ad6d2398e06954d4b7bdf0f212929 (patch) | |
tree | 6d81bafd7d4c88711e5700cf247f5412437bb3ec /Modules | |
parent | 5204329315453687e6d1b0fa4b802871cf4534dd (diff) | |
parent | eaf6f67f67e12c4e137c8e875ac277072bf910b6 (diff) | |
download | CMake-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.cmake | 9 |
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 ) |