mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 11:22:21 -06:00
Any `include_directories()` calls in toolchain files are used during our
ABI detection step even though it does not include any system headers.
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2), that check is also used
to detect implicit include directories. Any `include_directories()` in
a toolchain file are detected as implicit and later excluded from
explicit specification on compiler command lines, thus breaking the
purpose of the calls in the first place.
Fix the implicit include directory detection step to avoid using paths
from `include_directories()` calls in the toolchain file.
Fixes: #19079
20 lines
634 B
CMake
20 lines
634 B
CMake
include(RunCMake)
|
|
|
|
function(run_cmake_toolchain t)
|
|
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/${t}-toolchain.cmake)
|
|
run_cmake(${t})
|
|
endfunction()
|
|
|
|
run_cmake_toolchain(CallEnableLanguage)
|
|
run_cmake_toolchain(CallProject)
|
|
run_cmake_toolchain(FlagsInit)
|
|
run_cmake_toolchain(LinkFlagsInit)
|
|
|
|
function(run_IncludeDirectories)
|
|
run_cmake_toolchain(IncludeDirectories)
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncludeDirectories-build)
|
|
set(RunCMake_TEST_NO_CLEAN 1)
|
|
run_cmake_command(IncludeDirectories-build ${CMAKE_COMMAND} --build . --config Debug)
|
|
endfunction()
|
|
run_IncludeDirectories()
|