diff options
-rw-r--r-- | Copyright.txt | 1 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 4 | ||||
-rw-r--r-- | Help/prop_tgt/LANG_STANDARD.rst | 7 | ||||
-rw-r--r-- | Help/prop_tgt/LANG_STANDARD_REQUIRED.rst | 16 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_LINKER_PREFERENCE.rst | 2 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES.rst | 2 | ||||
-rw-r--r-- | Modules/CheckLinkerFlag.cmake | 49 | ||||
-rw-r--r-- | Modules/Internal/CheckCompilerFlag.cmake | 68 | ||||
-rw-r--r-- | Modules/Internal/CheckFlagCommonConfig.cmake | 75 | ||||
-rw-r--r-- | Modules/Internal/CheckLinkerFlag.cmake | 35 | ||||
-rw-r--r-- | Modules/Platform/Windows-IntelLLVM.cmake | 13 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CheckCompilerFlag/NonExistentLanguage-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CheckCompilerFlag/NotEnabledLanguage-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/FromPATHEnv.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/FromPrefixPath.cmake | 3 |
17 files changed, 166 insertions, 121 deletions
diff --git a/Copyright.txt b/Copyright.txt index ed25419..4b6a7f5 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -62,6 +62,7 @@ The following individuals and institutions are among the Contributors: * Helio Chissini de Castro <helio@kde.org> * Ilya Lavrenov <ilya.lavrenov@itseez.com> * Insight Software Consortium <insightsoftwareconsortium.org> +* Intel Corporation <www.intel.com> * Jan Woetzel * Jordan Williams <jordan@jwillikers.com> * Julien Schueller diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 51b092f..920bfe0 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -581,8 +581,6 @@ Variables for Languages /variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES /variable/CMAKE_LANG_LIBRARY_ARCHITECTURE /variable/CMAKE_LANG_LINK_EXECUTABLE - /variable/CMAKE_LANG_LINKER_PREFERENCE - /variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES /variable/CMAKE_LANG_LINKER_WRAPPER_FLAG /variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP /variable/CMAKE_LANG_OUTPUT_EXTENSION @@ -727,6 +725,8 @@ are subject to change, and not recommended for use in project code. /variable/CMAKE_LANG_COMPILER_ABI /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL + /variable/CMAKE_LANG_LINKER_PREFERENCE + /variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES /variable/CMAKE_LANG_PLATFORM_ID /variable/CMAKE_NOT_USING_CONFIG_FLAGS /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION diff --git a/Help/prop_tgt/LANG_STANDARD.rst b/Help/prop_tgt/LANG_STANDARD.rst index bd377ec..c83da01 100644 --- a/Help/prop_tgt/LANG_STANDARD.rst +++ b/Help/prop_tgt/LANG_STANDARD.rst @@ -15,6 +15,13 @@ newer standard is specified than is supported by the compiler, then it will fallback to the latest supported standard. This "decay" behavior may be controlled with the :prop_tgt:`<LANG>_STANDARD_REQUIRED` target property. +Note that the actual language standard used may be higher than that specified +by ``<LANG>_STANDARD``, regardless of the value of +:prop_tgt:`<LANG>_STANDARD_REQUIRED`. In particular, +:ref:`transitive usage requirements <Target Usage Requirements>` or the use of +:manual:`compile features <cmake-compile-features(7)>` can raise the required +language standard above what ``<LANG>_STANDARD`` specifies. + These properties are initialized by the value of the :variable:`CMAKE_<LANG>_STANDARD` variable if it is set when a target is created. diff --git a/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst b/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst index 56ecef8..e61125b 100644 --- a/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst @@ -11,16 +11,22 @@ The variations are: * :prop_tgt:`OBJCXX_STANDARD_REQUIRED` These properties specify whether the value of :prop_tgt:`<LANG>_STANDARD` is a -requirement. When ``OFF`` or unset, the :prop_tgt:`<LANG>_STANDARD` target +requirement. When false or unset, the :prop_tgt:`<LANG>_STANDARD` target property is treated as optional and may "decay" to a previous standard if the -requested is not available. +requested standard is not available. When ``<LANG>_STANDARD_REQUIRED`` is set +to true, :prop_tgt:`<LANG>_STANDARD` becomes a hard requirement and a fatal +error will be issued if that requirement cannot be met. + +Note that the actual language standard used may be higher than that specified +by :prop_tgt:`<LANG>_STANDARD`, regardless of the value of +``<LANG>_STANDARD_REQUIRED``. In particular, +:ref:`transitive usage requirements <Target Usage Requirements>` or the use of +:manual:`compile features <cmake-compile-features(7)>` can raise the required +language standard above what :prop_tgt:`<LANG>_STANDARD` specifies. These properties are initialized by the value of the :variable:`CMAKE_<LANG>_STANDARD_REQUIRED` variable if it is set when a target is created. -For supported CMake versions see the respective pages. -To control language standard versions see :prop_tgt:`<LANG>_STANDARD`. - See the :manual:`cmake-compile-features(7)` manual for information on compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_LANG_LINKER_PREFERENCE.rst b/Help/variable/CMAKE_LANG_LINKER_PREFERENCE.rst index ff82f8b..a4035bd 100644 --- a/Help/variable/CMAKE_LANG_LINKER_PREFERENCE.rst +++ b/Help/variable/CMAKE_LANG_LINKER_PREFERENCE.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINKER_PREFERENCE ------------------------------ +An internal variable subject to change. + Preference value for linker language selection. The "linker language" for executable, shared library, and module diff --git a/Help/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES.rst b/Help/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES.rst index dbbeb0a..df33edb 100644 --- a/Help/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES.rst +++ b/Help/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES ----------------------------------------- +An internal variable subject to change. + True if :variable:`CMAKE_<LANG>_LINKER_PREFERENCE` propagates across targets. This is used when CMake selects a linker language for a target. diff --git a/Modules/CheckLinkerFlag.cmake b/Modules/CheckLinkerFlag.cmake index e85e43e..8319216 100644 --- a/Modules/CheckLinkerFlag.cmake +++ b/Modules/CheckLinkerFlag.cmake @@ -38,53 +38,8 @@ effect or even a specific one is beyond the scope of this module. #]=======================================================================] include_guard(GLOBAL) - -include(CMakeCheckCompilerFlagCommonPatterns) - -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced -cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST +include(Internal/CheckLinkerFlag) function(CHECK_LINKER_FLAG _lang _flag _var) - get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES) - if (NOT _lang IN_LIST _supported_languages) - message (SEND_ERROR "check_linker_flag: ${_lang}: unknown language.") - return() - endif() - - include (CheckSourceCompiles) - - set(CMAKE_REQUIRED_LINK_OPTIONS "${_flag}") - - # Normalize locale during test compilation. - set(_locale_vars LC_ALL LC_MESSAGES LANG) - foreach(v IN LISTS _locale_vars) - set(_locale_vars_saved_${v} "$ENV{${v}}") - set(ENV{${v}} C) - endforeach() - - if (_lang MATCHES "^(C|CXX)$") - set (_source "int main() { return 0; }") - elseif (_lang STREQUAL "Fortran") - set (_source " program test\n stop\n end program") - elseif (_lang MATCHES "CUDA") - set (_source "__host__ int main() { return 0; }") - elseif (_lang MATCHES "HIP") - set (_source "__host__ int main() { return 0; }") - elseif (_lang MATCHES "^(OBJC|OBJCXX)$") - set (_source "#ifndef __OBJC__\n# error \"Not an Objective-C++ compiler\"\n#endif\nint main(void) { return 0; }") - else() - message (SEND_ERROR "check_linker_flag: ${_lang}: unsupported language.") - return() - endif() - check_compiler_flag_common_patterns(_common_patterns) - - check_source_compiles(${_lang} "${_source}" ${_var} ${_common_patterns}) - - foreach(v IN LISTS _locale_vars) - set(ENV{${v}} ${_locale_vars_saved_${v}}) - endforeach() - set(${_var} "${${_var}}" PARENT_SCOPE) + cmake_check_linker_flag(${_lang} "${_flag}" ${_var}) endfunction() - -cmake_policy(POP) diff --git a/Modules/Internal/CheckCompilerFlag.cmake b/Modules/Internal/CheckCompilerFlag.cmake index f6a4cc9..3a67691 100644 --- a/Modules/Internal/CheckCompilerFlag.cmake +++ b/Modules/Internal/CheckCompilerFlag.cmake @@ -2,71 +2,15 @@ # file Copyright.txt or https://cmake.org/licensing for details. include_guard(GLOBAL) +include(Internal/CheckFlagCommonConfig) include(Internal/CheckSourceCompiles) include(CMakeCheckCompilerFlagCommonPatterns) -cmake_policy(PUSH) -cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced -cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST - function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var) - - if(_lang STREQUAL "C") - set(_lang_src "int main(void) { return 0; }") - set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C" - FAIL_REGEX "-Werror=.* argument .* is not valid for C") - elseif(_lang STREQUAL "CXX") - set(_lang_src "int main() { return 0; }") - set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" - FAIL_REGEX "-Werror=.* argument .* is not valid for C\\+\\+") - elseif(_lang STREQUAL "CUDA") - set(_lang_src "__host__ int main() { return 0; }") - set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU - FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL "Fortran") - set(_lang_src " program test\n stop\n end program") - set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran") - elseif(_lang STREQUAL "HIP") - set(_lang_src "__host__ int main() { return 0; }") - set(_lang_fail_regex FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL "OBJC") - set(_lang_src [=[ -#ifndef __OBJC__ -# error "Not an Objective-C compiler" -#endif -int main(void) { return 0; }]=]) - set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU - FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL "OBJCXX") - set(_lang_src [=[ -#ifndef __OBJC__ -# error "Not an Objective-C++ compiler" -#endif -int main(void) { return 0; }]=]) - set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU - FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL "ISPC") - set(_lang_src "float func(uniform int32, float a) { return a / 2.25; }") - else() - message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.") - return() - endif() - - get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES) - if (NOT _lang IN_LIST _supported_languages) - message (SEND_ERROR "check_compiler_flag: ${_lang}: needs to be enabled before use.") - return() - endif() + cmake_check_flag_common_init("check_compiler_flag" ${_lang} _lang_src _lang_fail_regex) set(CMAKE_REQUIRED_DEFINITIONS ${_flag}) - # Normalize locale during test compilation. - set(_locale_vars LC_ALL LC_MESSAGES LANG) - foreach(v IN LISTS _locale_vars) - set(_locale_vars_saved_${v} "$ENV{${v}}") - set(ENV{${v}} C) - endforeach() - check_compiler_flag_common_patterns(_common_patterns) cmake_check_source_compiles(${_lang} "${_lang_src}" @@ -75,9 +19,5 @@ int main(void) { return 0; }]=]) ${_common_patterns} ) - foreach(v IN LISTS _locale_vars) - set(ENV{${v}} ${_locale_vars_saved_${v}}) - endforeach() -endfunction () - -cmake_policy(POP) + cmake_check_flag_common_finish() +endfunction() diff --git a/Modules/Internal/CheckFlagCommonConfig.cmake b/Modules/Internal/CheckFlagCommonConfig.cmake new file mode 100644 index 0000000..3934c02 --- /dev/null +++ b/Modules/Internal/CheckFlagCommonConfig.cmake @@ -0,0 +1,75 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# Do NOT include this module directly into any of your code. It is meant as +# a library for Check*CompilerFlag.cmake and Check*LinkerFlag.cma modules. +# It's content may change in any way between releases. + +include_guard(GLOBAL) +cmake_policy(PUSH) +cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced +cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST + +macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS) + if("${_LANG}" STREQUAL "C") + set(${_SRC} "int main(void) { return 0; }") + set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for C" + FAIL_REGEX "-Werror=.* argument .* is not valid for C") + elseif("${_LANG}" STREQUAL "CXX") + set(${_SRC} "int main() { return 0; }") + set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" + FAIL_REGEX "-Werror=.* argument .* is not valid for C\\+\\+") + elseif("${_LANG}" STREQUAL "CUDA") + set(${_SRC} "__host__ int main() { return 0; }") + set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU + FAIL_REGEX "argument unused during compilation: .*") # Clang + elseif("${_LANG}" STREQUAL "Fortran") + set(${_SRC} " program test\n stop\n end program") + set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran") + elseif("${_LANG}" STREQUAL "HIP") + set(${_SRC} "__host__ int main() { return 0; }") + set(${_PATTERNS} FAIL_REGEX "argument unused during compilation: .*") # Clang + elseif("${_LANG}" STREQUAL "OBJC") + set(${_SRC} [=[ + #ifndef __OBJC__ + # error "Not an Objective-C compiler" + #endif + int main(void) { return 0; }]=]) + set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU + FAIL_REGEX "argument unused during compilation: .*") # Clang + elseif("${_LANG}" STREQUAL "OBJCXX") + set(${_SRC} [=[ + #ifndef __OBJC__ + # error "Not an Objective-C++ compiler" + #endif + int main(void) { return 0; }]=]) + set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU + FAIL_REGEX "argument unused during compilation: .*") # Clang + elseif("${_LANG}" STREQUAL "ISPC") + set(${_SRC} "float func(uniform int32, float a) { return a / 2.25; }") + else() + message (SEND_ERROR "${_FUNC}: ${_LANG}: unknown language.") + return() + endif() + + get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES) + if (NOT "${_LANG}" IN_LIST _supported_languages) + message (SEND_ERROR "${_FUNC}: ${_LANG}: needs to be enabled before use.") + return() + endif() + # Normalize locale during test compilation. + set(_locale_vars LC_ALL LC_MESSAGES LANG) + foreach(v IN LISTS _locale_vars) + set(_CMAKE_CHECK_FLAG_COMMON_CONFIG_locale_vars_saved_${v} "$ENV{${v}}") + set(ENV{${v}} C) + endforeach() +endmacro() + +macro(CMAKE_CHECK_FLAG_COMMON_FINISH) + foreach(v IN LISTS _CFCC_locale_vars) + set(ENV{${v}} ${_CMAKE_CHECK_FLAG_COMMON_CONFIG_locale_vars_saved_${v}}) + endforeach() +endmacro() + +cmake_policy(POP) diff --git a/Modules/Internal/CheckLinkerFlag.cmake b/Modules/Internal/CheckLinkerFlag.cmake new file mode 100644 index 0000000..285372a --- /dev/null +++ b/Modules/Internal/CheckLinkerFlag.cmake @@ -0,0 +1,35 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include_guard(GLOBAL) +include(Internal/CheckFlagCommonConfig) +include(Internal/CheckSourceCompiles) +include(CMakeCheckCompilerFlagCommonPatterns) + +cmake_policy(PUSH) +cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced + +function(CMAKE_CHECK_LINKER_FLAG _lang _flag _var) + # link step supports less languages than the compiler + # so do a first check about the requested language + if (_lang STREQUAL "ISPC") + message (SEND_ERROR "check_linker_flag: ${_lang}: unsupported language.") + return() + endif() + + cmake_check_flag_common_init("check_linker_flag" ${_lang} _lang_src _lang_fail_regex) + + set(CMAKE_REQUIRED_LINK_OPTIONS "${_flag}") + + check_compiler_flag_common_patterns(_common_patterns) + cmake_check_source_compiles(${_lang} + "${_lang_src}" + ${_var} + ${_lang_fail_regex} + ${_common_patterns} + ) + + cmake_check_flag_common_finish() +endfunction() + +cmake_policy(POP) diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake index b9ea037..4687bee 100644 --- a/Modules/Platform/Windows-IntelLLVM.cmake +++ b/Modules/Platform/Windows-IntelLLVM.cmake @@ -12,6 +12,19 @@ include(Platform/Windows-MSVC) macro(__windows_compiler_intel lang) __windows_compiler_msvc(${lang}) + # For DPCPP other offload cases, some link flags need to go to the compiler + # driver and others need to go to the linker. Pass the compiler linking flags + # in CMAKE_${lang}_LINK_FLAGS and linker flags in LINK_FLAGS + set(CMAKE_${lang}_LINK_EXECUTABLE + "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + "${_CMAKE_VS_LINK_DLL}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD -link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + if (NOT "${lang}" STREQUAL "Fortran" OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1) + # The Fortran driver does not support -fuse-ld=llvm-lib before compiler version 2022.1 + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY + "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o <TARGET> -link <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + endif() + set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>") set(CMAKE_${lang}_DEPFILE_FORMAT gcc) endmacro() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 87305ec..5edd5c0 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 22) -set(CMake_VERSION_PATCH 20220115) +set(CMake_VERSION_PATCH 20220118) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Tests/RunCMake/CheckCompilerFlag/NonExistentLanguage-stderr.txt b/Tests/RunCMake/CheckCompilerFlag/NonExistentLanguage-stderr.txt index 89d0565..99491e8 100644 --- a/Tests/RunCMake/CheckCompilerFlag/NonExistentLanguage-stderr.txt +++ b/Tests/RunCMake/CheckCompilerFlag/NonExistentLanguage-stderr.txt @@ -1,2 +1,2 @@ -CMake Error at .*CheckCompilerFlag\.cmake:[0-9]+ \(message\): +CMake Error at .*CheckFlagCommonConfig\.cmake:[0-9]+ \(message\): check_compiler_flag: FAKE_LANG: unknown language. diff --git a/Tests/RunCMake/CheckCompilerFlag/NotEnabledLanguage-stderr.txt b/Tests/RunCMake/CheckCompilerFlag/NotEnabledLanguage-stderr.txt index 23dd4a1..82c47e3 100644 --- a/Tests/RunCMake/CheckCompilerFlag/NotEnabledLanguage-stderr.txt +++ b/Tests/RunCMake/CheckCompilerFlag/NotEnabledLanguage-stderr.txt @@ -1,2 +1,2 @@ -CMake Error at .*CheckCompilerFlag\.cmake:[0-9]+ \(message\): +CMake Error at .*CheckFlagCommonConfig\.cmake:[0-9]+ \(message\): check_compiler_flag: C: needs to be enabled before use. diff --git a/Tests/RunCMake/find_library/FromPATHEnv.cmake b/Tests/RunCMake/find_library/FromPATHEnv.cmake index c24e640..ba4dd37 100644 --- a/Tests/RunCMake/find_library/FromPATHEnv.cmake +++ b/Tests/RunCMake/find_library/FromPATHEnv.cmake @@ -1,6 +1,8 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") @@ -33,3 +35,4 @@ foreach(path "/does_not_exist" "/lib" "") endforeach() set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) set(ENV{PATH} "${ENV_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") diff --git a/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake b/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake index c24e640..ba4dd37 100644 --- a/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake +++ b/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake @@ -1,6 +1,8 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") @@ -33,3 +35,4 @@ foreach(path "/does_not_exist" "/lib" "") endforeach() set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) set(ENV{PATH} "${ENV_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") diff --git a/Tests/RunCMake/find_library/FromPrefixPath.cmake b/Tests/RunCMake/find_library/FromPrefixPath.cmake index 04763a9..52814e8 100644 --- a/Tests/RunCMake/find_library/FromPrefixPath.cmake +++ b/Tests/RunCMake/find_library/FromPrefixPath.cmake @@ -1,7 +1,9 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") set(ENV{PATH} "") +set(ENV{CMAKE_PREFIX_PATH} "") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") @@ -22,3 +24,4 @@ foreach(path "/does_not_exist" "/lib" "") endforeach() set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) set(ENV{PATH} "${ENV_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") |