mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Follow the approach from commit 92320466dd (try_compile: Restore
platform-default link flags in pre-CMP0210 projects, 2026-08-22)
to make the CMP0181 policy setting available in `try_compile`
projects before the toolchain file is loaded.
Fixes: #28108
33 lines
1.1 KiB
CMake
33 lines
1.1 KiB
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(CheckLanguage)
|
|
run_cmake_toolchain(FlagsInit)
|
|
run_cmake_toolchain(LangVars)
|
|
run_cmake_toolchain(LinkFlagsInit)
|
|
run_cmake_toolchain(CMP0126-NEW)
|
|
run_cmake_toolchain(CMP0126-OLD)
|
|
run_cmake_toolchain(CMP0126-WARN)
|
|
run_cmake_toolchain(CMP0181-NEW)
|
|
run_cmake_toolchain(CMP0181-OLD)
|
|
run_cmake_toolchain(CMP0181-WARN)
|
|
run_cmake_toolchain(CMP0210-NEW)
|
|
run_cmake_toolchain(CMP0210-OLD)
|
|
run_cmake_toolchain(CMP0210-WARN)
|
|
run_cmake_toolchain(SetCompilerLoaded)
|
|
run_cmake_toolchain(SetCrossCompiling)
|
|
|
|
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()
|