diff options
25 files changed, 187 insertions, 88 deletions
diff --git a/Help/command/SUPPORTED_LANGUAGES.txt b/Help/command/SUPPORTED_LANGUAGES.txt new file mode 100644 index 0000000..a98c07a --- /dev/null +++ b/Help/command/SUPPORTED_LANGUAGES.txt @@ -0,0 +1,25 @@ + +Supported languages are ``C``, ``CXX`` (i.e. C++), ``CSharp`` (i.e. C#), ``CUDA``, +``OBJC`` (i.e. Objective-C), ``OBJCXX`` (i.e. Objective-C++), ``Fortran``, ``HIP``, +``ISPC``, ``Swift``, ``ASM``, ``ASM_NASM``, ``ASM_MARMASM``, ``ASM_MASM``, and ``ASM-ATT``. + + .. versionadded:: 3.8 + Added ``CSharp`` and ``CUDA`` support. + + .. versionadded:: 3.15 + Added ``Swift`` support. + + .. versionadded:: 3.16 + Added ``OBJC`` and ``OBJCXX`` support. + + .. versionadded:: 3.18 + Added ``ISPC`` support. + + .. versionadded:: 3.21 + Added ``HIP`` support. + + .. versionadded:: 3.26 + Added ``ASM_MARMASM`` support. + +If enabling ``ASM``, list it last so that CMake can check whether +compilers for other languages like ``C`` work for assembly too. diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst index d9103b8..21b38ba 100644 --- a/Help/command/enable_language.rst +++ b/Help/command/enable_language.rst @@ -9,24 +9,13 @@ Enable languages (CXX/C/OBJC/OBJCXX/Fortran/etc) Enables support for the named languages in CMake. This is the same as the :command:`project` command but does not create any of the extra -variables that are created by the project command. Example languages -are ``CXX``, ``C``, ``CUDA``, ``OBJC``, ``OBJCXX``, ``Fortran``, -``HIP``, ``ISPC``, and ``ASM``. +variables that are created by the project command. -.. versionadded:: 3.8 - Added ``CUDA`` support. +.. include:: SUPPORTED_LANGUAGES.txt -.. versionadded:: 3.16 - Added ``OBJC`` and ``OBJCXX`` support. - -.. versionadded:: 3.18 - Added ``ISPC`` support. - -.. versionadded:: 3.21 - Added ``HIP`` support. - -If enabling ``ASM``, enable it last so that CMake can check whether -compilers for other languages like ``C`` work for assembly too. +By default ``C`` and ``CXX`` are enabled if no language options are given. +Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages, +to skip enabling any languages. This command must be called in file scope, not in a function call. Furthermore, it must be called in the highest directory common to all diff --git a/Help/command/project.rst b/Help/command/project.rst index 4e57d09..ab93f3d 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -102,23 +102,9 @@ The options are: Can also be specified without ``LANGUAGES`` keyword per the first, short signature. Selects which programming languages are needed to build the project. - Supported languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``, - ``OBJC`` (i.e. Objective-C), ``OBJCXX``, ``Fortran``, ``HIP``, ``ISPC``, and ``ASM``. - By default ``C`` and ``CXX`` are enabled if no language options are given. - Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages, - to skip enabling any languages. - .. versionadded:: 3.8 - Added ``CUDA`` support. +.. include:: SUPPORTED_LANGUAGES.txt - .. versionadded:: 3.16 - Added ``OBJC`` and ``OBJCXX`` support. - - .. versionadded:: 3.18 - Added ``ISPC`` support. - - If enabling ``ASM``, list it last so that CMake can check whether - compilers for other languages like ``C`` work for assembly too. The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL`` options are intended for use as default values in package metadata and documentation. diff --git a/Help/release/dev/FindCUDAToolkit-nvrtc.rst b/Help/release/dev/FindCUDAToolkit-nvrtc.rst new file mode 100644 index 0000000..5f8bfdd --- /dev/null +++ b/Help/release/dev/FindCUDAToolkit-nvrtc.rst @@ -0,0 +1,5 @@ +FindCUDAToolkit-nvrtc +--------------------- + +* The :module:`FindCUDAToolkit` module now provides a target for + ``libnvrtc_static``, if found. diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index d621195..cd44cc6 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -380,6 +380,12 @@ Targets Created: - ``CUDA::nvrtc`` +.. versionadded:: 3.26 + + - ``CUDA::nvrtc_builtins`` + - ``CUDA::nvrtc_static`` starting in CUDA 11.5 + - ``CUDA::nvrtc_builtins_static`` starting in CUDA 11.5 + .. _`cuda_toolkit_nvjitlink`: nvJitLink @@ -1099,7 +1105,6 @@ if(CUDAToolkit_FOUND) EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") endif() - _CUDAToolkit_find_and_add_import_lib(nvrtc DEPS cuda_driver) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0) if(NOT TARGET CUDA::nvptxcompiler_static) _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver) @@ -1114,6 +1119,13 @@ if(CUDAToolkit_FOUND) _CUDAToolkit_find_and_add_import_lib(nvJitLink_static DEPS cuda_driver) endif() + _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins DEPS cuda_driver) + _CUDAToolkit_find_and_add_import_lib(nvrtc DEPS nvrtc_builtins nvJitLink) + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.5.0) + _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins_static DEPS cuda_driver) + _CUDAToolkit_find_and_add_import_lib(nvrtc_static DEPS nvrtc_builtins_static nvptxcompiler_static nvJitLink_static) + endif() + _CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml) if(WIN32) diff --git a/Modules/FindOpenSP.cmake b/Modules/FindOpenSP.cmake index 655dd65..25d0e6f 100644 --- a/Modules/FindOpenSP.cmake +++ b/Modules/FindOpenSP.cmake @@ -63,24 +63,17 @@ The following cache variables may also be set: #]=======================================================================] -if (NOT OpenSP_INCLUDE_DIR AND NOT OpenSP_LIBRARY) - find_package(PkgConfig) - if (PkgConfig_FOUND) - pkg_check_modules(OpenSP IMPORTED_TARGET GLOBAL opensp) - - if (OpenSP_FOUND) - add_library(OpenSP::OpenSP INTERFACE IMPORTED) - target_link_libraries(OpenSP::OpenSP INTERFACE PkgConfig::OpenSP) - - set(OpenSP_INCLUDE_DIR ${OpenSP_INCLUDE_DIRS}) - set(OpenSP_LIBRARY ${OpenSP_LIBRARIES}) - endif () - endif () +find_package(PkgConfig QUIET) +if (PkgConfig_FOUND) + pkg_check_modules(PC_OpenSP QUIET opensp) endif () if (NOT OpenSP_INCLUDE_DIR) find_path(OpenSP_INCLUDE_DIR NAMES ParserEventGeneratorKit.h + HINTS + ${PC_OpenSP_INCLUDEDIRS} + ${PC_OpenSP_INCLUDE_DIRS} PATH_SUFFIXES OpenSP opensp DOC "The OpenSP include directory" ) @@ -89,17 +82,23 @@ endif () if (NOT OpenSP_LIBRARY) find_library(OpenSP_LIBRARY_RELEASE NAMES osp libosp opensp libopensp sp133 libsp + HINTS + ${PC_OpenSP_LIBDIR} + ${PC_OpenSP_LIBRARY_DIRS} ) find_library(OpenSP_LIBRARY_DEBUG NAMES ospd libospd openspd libopenspd sp133d libspd + HINTS + ${PC_OpenSP_LIBDIR} + ${PC_OpenSP_LIBRARY_DIRS} ) include(SelectLibraryConfigurations) select_library_configurations(OpenSP) endif () -if (OpenSP_INCLUDE_DIR AND OpenSP_LIBRARY) +if (OpenSP_INCLUDE_DIR) if (EXISTS "${OpenSP_INCLUDE_DIR}/config.h") if (NOT OpenSP_VERSION) file(STRINGS "${OpenSP_INCLUDE_DIR}/config.h" opensp_version_str REGEX "^#define[\t ]+SP_VERSION[\t ]+\".*\"") @@ -116,38 +115,44 @@ if (OpenSP_INCLUDE_DIR AND OpenSP_LIBRARY) include(CheckCXXSymbolExists) check_cxx_symbol_exists(SP_MULTI_BYTE "${OpenSP_INCLUDE_DIR}/config.h" OpenSP_MULTI_BYTE) endif () +endif () - if (NOT TARGET OpenSP::OpenSP) - set(OpenSP_INCLUDE_DIRS ${OpenSP_INCLUDE_DIR}) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenSP + FOUND_VAR OpenSP_FOUND + REQUIRED_VARS OpenSP_LIBRARY OpenSP_INCLUDE_DIR + VERSION_VAR OpenSP_VERSION + ) + +mark_as_advanced(OpenSP_INCLUDE_DIR OpenSP_LIBRARY OpenSP_MULTI_BYTE) +if (OpenSP_FOUND) + set(OpenSP_INCLUDE_DIRS ${OpenSP_INCLUDE_DIR}) + if (NOT TARGET OpenSP::OpenSP) add_library(OpenSP::OpenSP UNKNOWN IMPORTED) - set_target_properties(OpenSP::OpenSP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${OpenSP_INCLUDE_DIRS}") + if (EXISTS "${OpenSP_LIBRARY}") + set_target_properties(OpenSP::OpenSP PROPERTIES + IMPORTED_LOCATION "${OpenSP_LIBRARY}") + endif () + set_target_properties(OpenSP::OpenSP PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OpenSP_INCLUDE_DIRS}") if (OpenSP_LIBRARY_RELEASE) - set_target_properties(OpenSP::OpenSP PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenSP_LIBRARY_RELEASE}") - set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(OpenSP::OpenSP PROPERTIES + IMPORTED_LOCATION_RELEASE "${OpenSP_LIBRARY_RELEASE}") + set_property(TARGET OpenSP::OpenSP APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) endif () if (OpenSP_LIBRARY_DEBUG) - set_target_properties(OpenSP::OpenSP PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenSP_LIBRARY_DEBUG}") - set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - endif () - - if (NOT OpenSP_LIBRARY_RELEASE AND NOT OpenSP_LIBRARY_DEBUG) - set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_LOCATION "${OpenSP_LIBRARY}") + set_target_properties(OpenSP::OpenSP PROPERTIES + IMPORTED_LOCATION_DEBUG "${OpenSP_LIBRARY_DEBUG}") + set_property(TARGET OpenSP::OpenSP APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) endif () endif () endif () -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OpenSP - FOUND_VAR OpenSP_FOUND - REQUIRED_VARS OpenSP_LIBRARY OpenSP_INCLUDE_DIR - VERSION_VAR OpenSP_VERSION - ) - -mark_as_advanced(OpenSP_INCLUDE_DIR OpenSP_LIBRARY OpenSP_MULTI_BYTE) - include(FeatureSummary) set_package_properties(OpenSP PROPERTIES URL "http://openjade.sourceforge.net/doc/index.htm" diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 069bc31..1b3056f 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -10,6 +10,8 @@ # cmake_policy(PUSH) +# list supports empty elements +cmake_policy (SET CMP0007 NEW) # numbers and boolean constants cmake_policy (SET CMP0012 NEW) # IN_LIST operator diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index fe199af..261fe5b 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 25) -set(CMake_VERSION_PATCH 20230120) +set(CMake_VERSION_PATCH 20230124) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index e33ebd7..6595323 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1352,12 +1352,30 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode } static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$"); if (!configValidator.find(parameters.front())) { - reportError(context, content->GetOriginalExpression(), - "Expression syntax not recognized."); - return std::string(); } + context->HadContextSensitiveCondition = true; + bool firstParam = true; for (auto const& param : parameters) { + if (!configValidator.find(param)) { + if (firstParam) { + reportError(context, content->GetOriginalExpression(), + "Expression syntax not recognized."); + return std::string(); + } + // for backwards compat invalid config names are only errors as + // the first parameter + std::ostringstream e; + /* clang-format off */ + e << "Warning evaluating generator expression:\n" + << " " << content->GetOriginalExpression() << "\n" + << "The config name of \"" << param << "\" is invalid"; + /* clang-format on */ + context->LG->GetCMakeInstance()->IssueMessage( + MessageType::WARNING, e.str(), context->Backtrace); + } + + firstParam = false; if (context->Config.empty()) { if (param.empty()) { return "1"; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5884823..4cfec22 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2049,7 +2049,7 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir, cmBuildOptions defaultBuildOptions(false, fast, PackageResolveMode::Disable); return this->Build(jobs, srcdir, bindir, projectName, newTarget, output, "", - config, defaultBuildOptions, false, + config, defaultBuildOptions, true, this->TryCompileTimeout); } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index a1eadb9..b80a06e 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -742,10 +742,13 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() this->NinjaSupportsMultilineDepfile = !cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion, RequiredNinjaVersionForMultilineDepfile()); - this->NinjaSupportsDyndeps = + this->NinjaSupportsDyndepsCxx = !cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion, - RequiredNinjaVersionForDyndeps()); - if (!this->NinjaSupportsDyndeps) { + RequiredNinjaVersionForDyndepsCxx()); + this->NinjaSupportsDyndepsFortran = + !cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion, + RequiredNinjaVersionForDyndepsFortran()); + if (!this->NinjaSupportsDyndepsFortran) { // The ninja version number is not new enough to have upstream support. // Our ninja branch adds ".dyndep-#" to its version number, // where '#' is a feature-specific version number. Extract it. @@ -756,7 +759,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() unsigned long dyndep = 0; cmStrToULong(fv, &dyndep); if (dyndep == 1) { - this->NinjaSupportsDyndeps = true; + this->NinjaSupportsDyndepsFortran = true; } } } @@ -856,7 +859,7 @@ bool cmGlobalNinjaGenerator::CheckLanguages( bool cmGlobalNinjaGenerator::CheckCxxModuleSupport() { this->CxxModuleSupportCheck(); - if (this->NinjaSupportsDyndeps) { + if (this->NinjaSupportsDyndepsCxx) { return true; } bool const diagnose = !this->DiagnosedCxxModuleNinjaSupport && @@ -869,7 +872,8 @@ bool cmGlobalNinjaGenerator::CheckCxxModuleSupport() "using Ninja version \n" " " << this->NinjaVersion << "\n" "due to lack of required features. " - "Ninja " << RequiredNinjaVersionForDyndeps() << " or higher is required." + "Ninja " << RequiredNinjaVersionForDyndepsCxx() << + " or higher is required." ; /* clang-format on */ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str()); @@ -880,7 +884,7 @@ bool cmGlobalNinjaGenerator::CheckCxxModuleSupport() bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const { - if (this->NinjaSupportsDyndeps) { + if (this->NinjaSupportsDyndepsFortran) { return true; } @@ -890,7 +894,8 @@ bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const "The Ninja generator does not support Fortran using Ninja version\n" " " << this->NinjaVersion << "\n" "due to lack of required features. " - "Ninja " << RequiredNinjaVersionForDyndeps() << " or higher is required." + "Ninja " << RequiredNinjaVersionForDyndepsFortran() << + " or higher is required." ; /* clang-format on */ mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 2b6d1cd..1436c83 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -389,7 +389,8 @@ public: { return "1.9"; } - static std::string RequiredNinjaVersionForDyndeps() { return "1.10"; } + static std::string RequiredNinjaVersionForDyndepsCxx() { return "1.11"; } + static std::string RequiredNinjaVersionForDyndepsFortran() { return "1.10"; } static std::string RequiredNinjaVersionForRestatTool() { return "1.10"; } static std::string RequiredNinjaVersionForUnconditionalRecompactTool() { @@ -578,7 +579,8 @@ private: bool NinjaSupportsImplicitOuts = false; bool NinjaSupportsManifestRestat = false; bool NinjaSupportsMultilineDepfile = false; - bool NinjaSupportsDyndeps = false; + bool NinjaSupportsDyndepsCxx = false; + bool NinjaSupportsDyndepsFortran = false; bool NinjaSupportsRestatTool = false; bool NinjaSupportsUnconditionalRecompactTool = false; bool NinjaSupportsMultipleOutputs = false; diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index a7a47ef..1e01dd6 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1498,6 +1498,17 @@ bool cmGlobalVisualStudio10Generator::IsMsBuildRestoreSupported() const cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer15_7_5)); } +bool cmGlobalVisualStudio10Generator::IsBuildInParallelSupported() const +{ + if (this->Version >= VSVersion::VS16) { + return true; + } + + static std::string const vsVer15_8_0 = "15.8.27705.0"; + cm::optional<std::string> vsVer = this->GetVSInstanceVersion(); + return (vsVer && + cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer15_8_0)); +} std::string cmGlobalVisualStudio10Generator::GetClFlagTableName() const { std::string const& toolset = this->GetPlatformToolsetString(); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 63c21c5..deed206 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -168,6 +168,7 @@ public: cmIDEFlagTable const* GetNasmFlagTable() const; bool IsMsBuildRestoreSupported() const; + bool IsBuildInParallelSupported() const; protected: cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name, diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index ce9a842..5065876 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1807,7 +1807,8 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule( outputs.str(), comment, ccg); } else { this->WriteCustomRuleCpp(*spe2, c, script, additional_inputs.str(), - outputs.str(), comment, ccg, symbolic); + outputs.str(), comment, ccg, symbolic, + command.GetUsesTerminal()); } } } @@ -1816,9 +1817,12 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp( Elem& e2, std::string const& config, std::string const& script, std::string const& additional_inputs, std::string const& outputs, std::string const& comment, cmCustomCommandGenerator const& ccg, - bool symbolic) + bool symbolic, bool uses_terminal) { const std::string cond = this->CalcCondition(config); + if (this->GlobalGenerator->IsBuildInParallelSupported() && !uses_terminal) { + e2.WritePlatformConfigTag("BuildInParallel", cond, "true"); + } e2.WritePlatformConfigTag("Message", cond, comment); e2.WritePlatformConfigTag("Command", cond, script); e2.WritePlatformConfigTag("AdditionalInputs", cond, additional_inputs); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 166cdf7..194fbaa 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -157,7 +157,8 @@ private: std::string const& additional_inputs, std::string const& outputs, std::string const& comment, - cmCustomCommandGenerator const& ccg, bool symbolic); + cmCustomCommandGenerator const& ccg, bool symbolic, + bool uses_terminal); void WriteCustomRuleCSharp(Elem& e0, std::string const& config, std::string const& commandName, std::string const& script, diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt index 2bee19f..a0b2572 100644 --- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt @@ -15,7 +15,7 @@ CMake Error: .* - due to lack of required features. Ninja 1.10 or higher is required. + due to lack of required features. Ninja 1.11 or higher is required. |CMake Error in CMakeLists.txt: The "nodyndep" target contains C\+\+ module sources which are not supported diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index 01d59f8..78afd5e 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -38,7 +38,7 @@ endif () set(generator_supports_cxx_modules 0) if (RunCMake_GENERATOR MATCHES "Ninja" AND - ninja_version VERSION_GREATER_EQUAL "1.10" AND + ninja_version VERSION_GREATER_EQUAL "1.11" AND "cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES) set(generator_supports_cxx_modules 1) endif () diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 130de2b..b61ccd2 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -25,4 +25,13 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + +CMake Warning at BadCONFIG.cmake:1 \(add_custom_target\): + Warning evaluating generator expression: + + \$<CONFIG:Release,Foo-Second> + + The config name of "Foo-Second" is invalid +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index 1735ab7..4d7a357 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -2,4 +2,5 @@ add_custom_target(check ALL COMMAND check $<CONFIG:.> $<CONFIG:Foo-Bar> $<$<CONFIG:Foo-Nested>:foo> + $<$<CONFIG:Release,Foo-Second>:foo> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 8d8c8dc..2d545d9 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -12,7 +12,6 @@ run_cmake(BadTargetTypeInterface) run_cmake(BadTargetTypeObject) run_cmake(BadInstallPrefix) run_cmake(BadSHELL_PATH) -run_cmake(BadCONFIG) run_cmake(CMP0044-WARN) run_cmake(NonValidTarget-C_COMPILER_ID) run_cmake(NonValidTarget-CXX_COMPILER_ID) diff --git a/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt b/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt index 72e0a01..91dfa6d 100644 --- a/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt +++ b/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt @@ -1 +1 @@ -.*Linking ISPC static library* +(Linking ISPC static library|[ \/]libcmTC_[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\.a|out:([A-Za-z]+[\/])?cmTC_[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\.lib) diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 51ccac8..29c0538 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -45,6 +45,8 @@ run_cmake(ProjectCopyFile) run_cmake(NonSourceCopyFile) run_cmake(NonSourceCompileDefinitions) +run_cmake(Verbose) + set(RunCMake_TEST_OPTIONS --debug-trycompile) run_cmake(PlatformVariables) run_cmake(WarnDeprecated) diff --git a/Tests/RunCMake/try_compile/Verbose.c b/Tests/RunCMake/try_compile/Verbose.c new file mode 100644 index 0000000..5953879 --- /dev/null +++ b/Tests/RunCMake/try_compile/Verbose.c @@ -0,0 +1,7 @@ +#ifndef EXAMPLE_DEFINITION +# error "EXAMPLE_DEFINITION not defined." +#endif +int main(void) +{ + return 0; +} diff --git a/Tests/RunCMake/try_compile/Verbose.cmake b/Tests/RunCMake/try_compile/Verbose.cmake new file mode 100644 index 0000000..3f2a7dd --- /dev/null +++ b/Tests/RunCMake/try_compile/Verbose.cmake @@ -0,0 +1,15 @@ +enable_language(C) + +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Verbose.c + COMPILE_DEFINITIONS -DEXAMPLE_DEFINITION + OUTPUT_VARIABLE out + ) +string(REPLACE "\n" "\n " out " ${out}") +if(NOT COMPILE_RESULT) + message(FATAL_ERROR "try_compile failed:\n${out}") +endif() +if(NOT out MATCHES "EXAMPLE_DEFINITION" + AND NOT CMAKE_GENERATOR MATCHES "NMake|Borland") + message(FATAL_ERROR "try_compile output does not contain EXAMPLE_DEFINITION:\n${out}") +endif() |