diff options
author | Christian Manning <cmanning999@gmail.com> | 2014-07-02 15:15:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-11-03 14:18:44 (GMT) |
commit | 45a25d63ba738e8b0ce690f8f02469a82815b5f4 (patch) | |
tree | 2fcbb6e2f69898d3dcde7ecfaa6e5dfd5a116e40 /Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake | |
parent | 6aa2d4773701d5b491c44e2c0eda202b46b36521 (diff) | |
download | CMake-45a25d63ba738e8b0ce690f8f02469a82815b5f4.zip CMake-45a25d63ba738e8b0ce690f8f02469a82815b5f4.tar.gz CMake-45a25d63ba738e8b0ce690f8f02469a82815b5f4.tar.bz2 |
Code Blocks/Eclipse: Use non-default stdlib includes when specified.
When -stdlib=x is specified in CMAKE_CXX_FLAGS this passes it along so
that the correct include dirs are detected.
Diffstat (limited to 'Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake')
-rw-r--r-- | Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 92b0d1d..0eacbba 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -26,11 +26,15 @@ 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 () 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} ${_stdlib} -v -E -x ${_lang} -dD dummy WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles ERROR_VARIABLE _gccOutput OUTPUT_VARIABLE _gccStdout ) |