diff --git a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx index 9963cff7d..465b43a6a 100644 --- a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx +++ b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx @@ -1,5 +1,6 @@ #include "mysqrt.h" +// TODO 4: include cmath #include namespace mathfunctions { diff --git a/Help/prop_tgt/AIX_SHARED_LIBRARY_ARCHIVE.rst b/Help/prop_tgt/AIX_SHARED_LIBRARY_ARCHIVE.rst index d0106c56f..9e81594fd 100644 --- a/Help/prop_tgt/AIX_SHARED_LIBRARY_ARCHIVE.rst +++ b/Help/prop_tgt/AIX_SHARED_LIBRARY_ARCHIVE.rst @@ -16,5 +16,7 @@ the :prop_tgt:`SOVERSION` target property, if set, and otherwise from the :prop_tgt:`VERSION` target property, if set. This property defaults to :variable:`CMAKE_AIX_SHARED_LIBRARY_ARCHIVE` -if that variable is set when a ``SHARED`` library target is created -by :command:`add_library`. +if that variable is set when a non-imported ``SHARED`` library target +is created by :command:`add_library`. Imported targets must explicitly +enable :prop_tgt:`!AIX_SHARED_LIBRARY_ARCHIVE` if they import an AIX +shared library archive. diff --git a/Help/release/3.31.rst b/Help/release/3.31.rst index 7eea32a8d..81ee1b10f 100644 --- a/Help/release/3.31.rst +++ b/Help/release/3.31.rst @@ -263,9 +263,9 @@ Updates Changes made since CMake 3.31.0 include the following. -3.31.1 ------- +3.31.1, 3.31.2 +-------------- -* This version made no changes to documented features or interfaces. +* These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions. diff --git a/Help/variable/CMAKE_AIX_SHARED_LIBRARY_ARCHIVE.rst b/Help/variable/CMAKE_AIX_SHARED_LIBRARY_ARCHIVE.rst index 10fdf043c..2b636c06a 100644 --- a/Help/variable/CMAKE_AIX_SHARED_LIBRARY_ARCHIVE.rst +++ b/Help/variable/CMAKE_AIX_SHARED_LIBRARY_ARCHIVE.rst @@ -6,5 +6,5 @@ CMAKE_AIX_SHARED_LIBRARY_ARCHIVE On AIX, enable creation of shared library archives. This variable initializes the :prop_tgt:`AIX_SHARED_LIBRARY_ARCHIVE` -target property on ``SHARED`` library targets as they are created -by :command:`add_library`. See that target property for details. +target property on non-imported ``SHARED`` library targets as they are +created by :command:`add_library`. See that target property for details. diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake index 317cfc742..367d26e09 100644 --- a/Modules/Compiler/Intel.cmake +++ b/Modules/Compiler/Intel.cmake @@ -30,6 +30,9 @@ else() string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3") string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g") + # Compiler + IPO does not recognize --dependency-file link option + set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) + if("${lang}" STREQUAL "CXX") set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}") if(CMAKE_${lang}_COMPILER_ARG1) diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index e0bdbc540..c741ec19b 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -3464,14 +3464,15 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS endif() # finalize library version information - _python_get_version (SABI_LIBRARY PREFIX _${_PYTHON_PREFIX}_) # ABI library does not have the full version information - if (${_PYTHON_PREFIX}_Interpreter_FOUND OR _${_PYTHON_PREFIX}_LIBRARY_RELEASE) - # update from interpreter or library + if (${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE) + # update from interpreter set (_${_PYTHON_PREFIX}_VERSION ${${_PYTHON_PREFIX}_VERSION}) set (_${_PYTHON_PREFIX}_VERSION_MAJOR ${${_PYTHON_PREFIX}_VERSION_MAJOR}) set (_${_PYTHON_PREFIX}_VERSION_MINOR ${${_PYTHON_PREFIX}_VERSION_MINOR}) set (_${_PYTHON_PREFIX}_VERSION_PATCH ${${_PYTHON_PREFIX}_VERSION_PATCH}) + elseif(NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE) + _python_get_version (SABI_LIBRARY PREFIX _${_PYTHON_PREFIX}_) endif() set (${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE}") diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 4cc17c763..1da066abd 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -5,22 +5,17 @@ FindRuby -------- -Find Ruby - -This module finds if Ruby is installed and determines where the -include files and libraries are. Ruby 1.8 through 3.3 are -supported. +This module determines if Ruby is installed and finds the locations of its +include files and libraries. Ruby 1.8 through 3.4 are supported. The minimum required version of Ruby can be specified using the standard syntax, e.g. .. code-block:: cmake - find_package(Ruby 2.5.1 EXACT REQUIRED) + find_package(Ruby 3.2.6 EXACT REQUIRED) # OR - find_package(Ruby 2.4) - -It also determines what the name of the library is. + find_package(Ruby 3.2) Virtual environments such as RVM are handled as well, by passing the argument ``Ruby_FIND_VIRTUALENV`` @@ -40,7 +35,7 @@ This module will set the following variables in your project: .. versionadded:: 3.18 libraries needed to use ruby from C. ``Ruby_VERSION`` - the version of ruby which was found, e.g. "1.8.7" + the version of ruby which was found, e.g. "3.2.6" ``Ruby_VERSION_MAJOR`` Ruby major version. ``Ruby_VERSION_MINOR`` @@ -136,13 +131,13 @@ set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${Ruby_FIND_VERSION # Set name of possible executables, ignoring the minor # Eg: -# 2.1.1 => from ruby33 to ruby21 included -# 2.1 => from ruby33 to ruby21 included -# 2 => from ruby33 to ruby20 included -# empty => from ruby33 to ruby18 included +# 3.2.6 => from ruby34 to ruby32 included +# 3.2 => from ruby34 to ruby32 included +# 3 => from ruby34 to ruby30 included +# empty => from ruby34 to ruby18 included if(NOT Ruby_FIND_VERSION_EXACT) - foreach(_ruby_version RANGE 33 18 -1) + foreach(_ruby_version RANGE 34 18 -1) string(SUBSTRING "${_ruby_version}" 0 1 _ruby_major_version) string(SUBSTRING "${_ruby_version}" 1 1 _ruby_minor_version) diff --git a/Modules/Linker/GNU.cmake b/Modules/Linker/GNU.cmake index ca3457a96..978ac12a2 100644 --- a/Modules/Linker/GNU.cmake +++ b/Modules/Linker/GNU.cmake @@ -11,7 +11,7 @@ cmake_policy(SET CMP0140 NEW) function(__linker_gnu lang) # define flags for linker depfile generation - set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,") + set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file=") set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc) if(NOT CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 27525b7bf..5f601b701 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 31) -set(CMake_VERSION_PATCH 1) +set(CMake_VERSION_PATCH 2) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) @@ -21,7 +21,7 @@ endif() if(NOT CMake_VERSION_NO_GIT) # If this source was exported by 'git archive', use its commit info. - set(git_info [==[eb281d3454 CMake 3.31.1]==]) + set(git_info [==[793c5f11f6 CMake 3.31.2]==]) # Otherwise, try to identify the current development source version. if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " diff --git a/Source/cmExportCMakeConfigGenerator.cxx b/Source/cmExportCMakeConfigGenerator.cxx index 4f4765c96..e85d949ee 100644 --- a/Source/cmExportCMakeConfigGenerator.cxx +++ b/Source/cmExportCMakeConfigGenerator.cxx @@ -334,6 +334,12 @@ void cmExportCMakeConfigGenerator::GenerateImportTargetCode( os << "set_property(TARGET " << targetName << " PROPERTY BUNDLE 1)\n"; } + // Mark the imported library if it is an AIX shared library archive. + if (target->IsArchivedAIXSharedLibrary()) { + os << "set_property(TARGET " << targetName + << " PROPERTY AIX_SHARED_LIBRARY_ARCHIVE 1)\n"; + } + // generate DEPRECATION if (target->IsDeprecated()) { os << "set_property(TARGET " << targetName << " PROPERTY DEPRECATION " diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 7f4e4ac77..80eedf534 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -3592,6 +3592,12 @@ struct TargetFilesystemArtifactResultCreator "SHARED libraries."); return std::string(); } + if (target->IsArchivedAIXSharedLibrary()) { + ::reportError(context, content->GetOriginalExpression(), + "TARGET_SONAME_FILE is not allowed for " + "AIX_SHARED_LIBRARY_ARCHIVE libraries."); + return std::string(); + } std::string result = cmStrCat(target->GetDirectory(context->Config), '/', target->GetSOName(context->Config)); return result; @@ -3618,6 +3624,12 @@ struct TargetFilesystemArtifactResultCreator "SHARED libraries."); return std::string(); } + if (target->IsArchivedAIXSharedLibrary()) { + ::reportError(context, content->GetOriginalExpression(), + "TARGET_SONAME_IMPORT_FILE is not allowed for " + "AIX_SHARED_LIBRARY_ARCHIVE libraries."); + return std::string(); + } if (target->HasImportLibrary(context->Config)) { return cmStrCat(target->GetDirectory( diff --git a/Source/cmGeneratorTarget_Options.cxx b/Source/cmGeneratorTarget_Options.cxx index d8b3eb32d..5ac42bf89 100644 --- a/Source/cmGeneratorTarget_Options.cxx +++ b/Source/cmGeneratorTarget_Options.cxx @@ -551,8 +551,9 @@ std::vector>& cmGeneratorTarget::ResolveLinkerWrapper( const std::string SHELL{ "SHELL:" }; const std::string LINKER_SHELL = LINKER + SHELL; - for (auto entry = result.begin(); entry != result.end(); ++entry) { + for (auto entry = result.begin(); entry != result.end();) { if (entry->Value.compare(0, LINKER.length(), LINKER) != 0) { + ++entry; continue; } @@ -594,10 +595,10 @@ std::vector>& cmGeneratorTarget::ResolveLinkerWrapper( if (joinItems) { result.insert( entry, cmJoin(cmMakeRange(options.begin(), options.end()), " "_s)); - entry = std::next(result.begin(), index); + entry = std::next(result.begin(), index + 1); } else { result.insert(entry, options.begin(), options.end()); - entry = std::next(result.begin(), index + options.size() - 1); + entry = std::next(result.begin(), index + options.size()); } } return result; diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx index 01980ac1a..79b18e53b 100644 --- a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx +++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx @@ -107,11 +107,13 @@ void cmInstallImportedRuntimeArtifactsGenerator::GenerateScriptForConfig( } } else { std::vector files{ location }; - auto soName = this->Target->GetSOName(config); - auto soNameFile = - cmStrCat(this->Target->GetDirectory(config), '/', soName); - if (!soName.empty() && soNameFile != location) { - files.push_back(soNameFile); + if (!this->Target->IsArchivedAIXSharedLibrary()) { + auto soName = this->Target->GetSOName(config); + auto soNameFile = + cmStrCat(this->Target->GetDirectory(config), '/', soName); + if (!soName.empty() && soNameFile != location) { + files.push_back(soNameFile); + } } this->AddInstallRule(os, this->GetDestination(config), cmInstallType_SHARED_LIBRARY, files, diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 42b517e58..f72e4b42e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1626,8 +1626,6 @@ void cmLocalGenerator::GetTargetFlags( this->AppendPositionIndependentLinkerFlags(extraLinkFlags, target, config, linkLanguage); this->AppendIPOLinkerFlags(extraLinkFlags, target, config, linkLanguage); - this->AppendDependencyInfoLinkerFlags(extraLinkFlags, target, config, - linkLanguage); this->AppendModuleDefinitionFlag(extraLinkFlags, target, linkLineComputer, config); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 891187a89..65353718d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -1277,6 +1277,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( vars["LINK_LIBRARIES"], vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, gt); + localGen.AppendDependencyInfoLinkerFlags(vars["LINK_FLAGS"], gt, config, + this->TargetLinkLanguage(config)); + // Add OS X version flags, if any. if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 1fd406c50..c9dd1547b 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1340,12 +1340,9 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() } if (this->Uic.Enabled) { - // Make all ui_*.h files byproducts of the ${target}_autogen/timestamp - // custom command if the generation of depfile is enabled. - auto& byProducts = useDepfile ? timestampByproducts : autogenByproducts; for (auto const& file : this->Uic.UiHeaders) { this->AddGeneratedSource(file.first, this->Uic); - byProducts.push_back(file.second); + autogenByproducts.push_back(file.second); } } @@ -1483,16 +1480,6 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() } } - // For the Ninja, Makefile and Qt >= 5.15, add custom commands that create - // XXX_autogen/timestamp files. Those custom commands have a depfile - // assigned that is generated from the depfiles that were created by moc. - // - // The XXX_autogen targets merely wrap the XXX_autogen/timestamp custom - // commands. - // The dependency tree would then look like - // the original dependencies of '_autogen' target <-'/timestamp' file - // <- '_autogen' target - cmTarget* timestampTarget = nullptr; std::vector dependencies( this->AutogenTarget.DependFiles.begin(), @@ -1500,6 +1487,40 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() if (useDepfile) { // Create a custom command that generates a timestamp file and // has a depfile assigned. The depfile is created by JobDepFilesMergeT. + // + // Also create an additional '_autogen_timestamp_deps' that the custom + // command will depend on. It will have no sources or commands to + // execute, but it will have dependencies that would originally be + // assigned to the pre-Qt 5.15 'autogen' target. These dependencies will + // serve as a list of order-only dependencies for the custom command, + // without forcing the custom command to re-execute. + // + // The dependency tree would then look like + // '_autogen_timestamp_deps (order-only)' <- '/timestamp' file <- + // '_autogen' target. + const auto timestampTargetName = + cmStrCat(this->GenTarget->GetName(), "_autogen_timestamp_deps"); + + auto cc = cm::make_unique(); + cc->SetWorkingDirectory(this->Dir.Work.c_str()); + cc->SetDepends(dependencies); + cc->SetEscapeOldStyle(false); + timestampTarget = this->LocalGen->AddUtilityCommand(timestampTargetName, + true, std::move(cc)); + + this->LocalGen->AddGeneratorTarget( + cm::make_unique(timestampTarget, this->LocalGen)); + + // Set FOLDER property on the timestamp target, so it appears in the + // appropriate folder in an IDE or in the file api. + if (!this->TargetsFolder.empty()) { + timestampTarget->SetProperty("FOLDER", this->TargetsFolder); + } + + // Make '/timestamp' file depend on '_autogen_timestamp_deps' and on the + // moc and uic executables (whichever are enabled). + dependencies.clear(); + dependencies.push_back(timestampTargetName); AddAutogenExecutableToDependencies(this->Moc, dependencies); AddAutogenExecutableToDependencies(this->Uic, dependencies); @@ -1544,7 +1565,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile })); this->AddGeneratedSource(outputFile, this->Moc); } - auto cc = cm::make_unique(); + cc = cm::make_unique(); cc->SetOutputs(outputFile); cc->SetByproducts(timestampByproducts); cc->SetDepends(dependencies); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f22083740..f1dcc7673 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1087,6 +1087,11 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } } + // Imported targets must set AIX_SHARED_LIBRARY_ARCHIVE explicitly. + if (this->IsImported() && property == "AIX_SHARED_LIBRARY_ARCHIVE"_s) { + return; + } + // Replace everything after "CMAKE_" defKey.replace(defKey.begin() + 6, defKey.end(), property); if (cmValue value = mf->GetDefinition(defKey)) { diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 2cc235469..f6d32b8dd 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -5,6 +5,8 @@ if(POLICY CMP0129) endif() project(Export C CXX) +set(CMAKE_AIX_SHARED_LIBRARY_ARCHIVE 1) + find_package(Foo REQUIRED CONFIG NO_DEFAULT_PATH) # Pretend that RelWithDebInfo should link to debug libraries to test @@ -482,8 +484,8 @@ add_library(testMod1 MODULE empty.cpp) add_library(testMod2 MODULE empty.cpp) set_property(TARGET testMod2 PROPERTY BUNDLE 1) -add_library(testSharedLibArchiveAIX SHARED testSharedLibArchiveAIX.c) -set_property(TARGET testSharedLibArchiveAIX PROPERTY AIX_SHARED_LIBRARY_ARCHIVE 1) +add_library(testSharedObjectAIX SHARED testSharedObjectAIX.c) +set_property(TARGET testSharedObjectAIX PROPERTY AIX_SHARED_LIBRARY_ARCHIVE 0) install(TARGETS testLibRequired EXPORT RequiredExp DESTINATION lib @@ -625,7 +627,7 @@ install( systemlib testInterfaceIncludeUser testInterfaceIncludeUser2 - testSharedLibArchiveAIX + testSharedObjectAIX EXPORT exp RUNTIME DESTINATION $<1:bin>$<0:/wrong> LIBRARY DESTINATION $<1:lib>$<0:/wrong> NAMELINK_SKIP @@ -703,7 +705,7 @@ export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe4 te testExeWithPluginHelper testExePluginHelperObj testMod1 testMod2 testLibPerConfigDest - testSharedLibArchiveAIX + testSharedObjectAIX NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake ) diff --git a/Tests/ExportImport/Export/testSharedLibArchiveAIX.c b/Tests/ExportImport/Export/testSharedObjectAIX.c similarity index 75% rename from Tests/ExportImport/Export/testSharedLibArchiveAIX.c rename to Tests/ExportImport/Export/testSharedObjectAIX.c index 25a29e002..9879c3901 100644 --- a/Tests/ExportImport/Export/testSharedLibArchiveAIX.c +++ b/Tests/ExportImport/Export/testSharedObjectAIX.c @@ -4,7 +4,7 @@ # define EXPORT #endif -EXPORT int testSharedLibArchiveAIX(void) +EXPORT int testSharedObjectAIX(void) { return 0; } diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 84a50a668..7d933a4d5 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -68,7 +68,7 @@ target_link_libraries(imp_testExe1 exp_testLib7 exp_testLibCycleA exp_testLibPerConfigDest - exp_testSharedLibArchiveAIX + exp_testSharedObjectAIX exp_testStaticLibWithPlugin ) @@ -124,7 +124,7 @@ target_link_libraries(imp_testExe1b bld_testLib7 bld_testLibCycleA bld_testLibPerConfigDest - bld_testSharedLibArchiveAIX + bld_testSharedObjectAIX bld_testStaticLibWithPlugin ) diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c index 7f30c5dad..554bf4be9 100644 --- a/Tests/ExportImport/Import/A/imp_testExe1.c +++ b/Tests/ExportImport/Import/A/imp_testExe1.c @@ -11,7 +11,7 @@ extern int testLib7(void); extern int testLibCycleA1(void); extern int testLibPerConfigDest(void); extern int testStaticLibPlugin(void); -extern int testSharedLibArchiveAIX(void); +extern int testSharedObjectAIX(void); /* Switch a symbol between debug and optimized builds to make sure the proper library is found from the testLib4 link interface. */ @@ -27,6 +27,6 @@ int main(void) return (testLib2() + generated_by_testExe1() + testLib3() + testLib4() + testLib5() + testLib6() + testLib7() + testLibCycleA1() + testLibPerConfigDest() + testStaticLibPlugin() + - testSharedLibArchiveAIX() + generated_by_testExe3() + + testSharedObjectAIX() + generated_by_testExe3() + generated_by_testExe4() + testLib4lib() + testLib4libcfg()); } diff --git a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt index 5df01c639..8be39bf18 100644 --- a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt +++ b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt @@ -16,6 +16,55 @@ else() set(USER_INCLUDE_DIR "/path/to/invalid/dir") endif() +# check some combinations for modules search without interpreter +block(SCOPE_FOR VARIABLES) + find_package(Python3 REQUIRED COMPONENTS Development.SABIModule) + if (NOT Python3_FOUND) + message (FATAL_ERROR "Failed to find Python 3") + endif() + if (Python3_Development_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found") + endif() + if (Python3_Interpreter_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Interpreter' unexpectedly found") + endif() + if (Python3_Development.Embed_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found") + endif() + if (Python3_Development.Module_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' unexpectedly found") + endif() + if (NOT Python3_Development.SABIModule_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development.SABIModule' not found") + endif() + unset(_Python3_SABI_LIBRARY_RELEASE CACHE) +endblock() + +block(SCOPE_FOR VARIABLES) + find_package(Python3 REQUIRED COMPONENTS Development.Module Development.SABIModule) + if (NOT Python3_FOUND) + message (FATAL_ERROR "Failed to find Python 3") + endif() + if (Python3_Development_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found") + endif() + if (Python3_Interpreter_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Interpreter' unexpectedly found") + endif() + if (Python3_Development.Embed_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found") + endif() + if (NOT Python3_Development.Module_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' not found") + endif() + if (NOT Python3_Development.SABIModule_FOUND) + message (FATAL_ERROR "Python 3, COMPONENT 'Development.SABIModule' not found") + endif() + unset(_Python3_LIBRARY_RELEASE CACHE) + unset(_Python3_SABI_LIBRARY_RELEASE CACHE) +endblock() + + set(components Interpreter Development) if (CMake_TEST_FindPython3_SABIModule AND WIN32) list (APPEND components Development.SABIModule) diff --git a/Tests/RunCMake/Autogen_6/RunCMakeTest.cmake b/Tests/RunCMake/Autogen_6/RunCMakeTest.cmake index b629a5cfe..65d58a957 100644 --- a/Tests/RunCMake/Autogen_6/RunCMakeTest.cmake +++ b/Tests/RunCMake/Autogen_6/RunCMakeTest.cmake @@ -1,3 +1,4 @@ + include(RunCMake) include(Autogen_common/utils) @@ -10,18 +11,18 @@ if (DEFINED with_qt_version) if (QtCore_VERSION VERSION_GREATER_EQUAL 5.15.0) macro(set_test_variables_for_unwanted_builds) if (RunCMake_GENERATOR MATCHES "Ninja") - set(RunCMake_TEST_NOT_EXPECT_stdout "widget2.cpp.o.d|mainwindow.cpp.o.d") + set(RunCMake_TEST_EXPECT_stdout "ninja: no work to do.") elseif (RunCMake_GENERATOR MATCHES "Make") - set(RunCMake_TEST_NOT_EXPECT_stdout "Building CXX object multi_ui_files/CMakeFiles/example.dir/src/widget2.cpp.o|\ - Building CXX object multi_ui_files/CMakeFiles/example.dir/src/mainwindow.cpp.o") + set(RunCMake_TEST_NOT_EXPECT_stdout "Building CXX object multi_ui_files/CMakeFiles/example.dir/src/main.cpp.o|\ + Building CXX object multi_ui_files/CMakeFiles/example.dir/src/widget.cpp.o") elseif (RunCMake_GENERATOR MATCHES "Visual Studio") - set(RunCMake_TEST_NOT_EXPECT_stdout "widget2.cpp|mainwindow.cpp") + set(RunCMake_TEST_NOT_EXPECT_stdout "widget.cpp") elseif (RunCMake_GENERATOR MATCHES "Xcode") - set(RunCMake_TEST_NOT_EXPECT_stdout "widget2.cpp|mainwindow.cpp") + set(RunCMake_TEST_NOT_EXPECT_stdout "widget.cpp") endif() endmacro() - function(uic_build_test test_name binary_dir source_dir file_to_touch test_config) + function(uic_incremental_build_test test_name binary_dir source_dir test_config) set(RunCMake_TEST_BINARY_DIR ${binary_dir}) set(RunCMake_TEST_SOURCE_DIR ${source_dir}) @@ -38,13 +39,14 @@ if (DEFINED with_qt_version) endif() run_cmake_with_options(${test_name} ${RunCMake_TEST_OPTIONS} ${config_arg}) set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_VARIANT_DESCRIPTION "${RunCMake_TEST_VARIANT_DESCRIPTION}-First build") + run_cmake_command("${test_name}-build" ${CMAKE_COMMAND} --build . ${test_verbose_arg} ${multiconfig_config_arg}) + set(RunCMake_TEST_VARIANT_DESCRIPTION "${config_desc}-Second build") run_cmake_command("${test_name}-build" ${CMAKE_COMMAND} --build . ${test_verbose_arg} ${multiconfig_config_arg}) - file(TOUCH ${file_to_touch}) - set(RunCMake_TEST_VARIANT_DESCRIPTION "${config_desc}-first_build_after_touching") + set(RunCMake_TEST_VARIANT_DESCRIPTION "${config_desc}-No files were built on the third build") set_test_variables_for_unwanted_builds() run_cmake_command("${test_name}-build" ${CMAKE_COMMAND} --build . ${test_verbose_arg} ${multiconfig_config_arg}) - message(STATUS "${test_name}-build${config_desc}-Only build files that were touched were built - PASSED") endfunction() if(RunCMake_GENERATOR MATCHES "Make|Ninja|Visual Studio|Xcode") @@ -59,11 +61,9 @@ if (DEFINED with_qt_version) set(config_desc "-${config}") endif() - uic_build_test(multi_ui_files_touch_ui ${RunCMake_BINARY_DIR}/multi_ui_files_touch_ui${config_desc}-build - ${RunCMake_SOURCE_DIR}/multi_ui_files ${RunCMake_SOURCE_DIR}/multi_ui_files/src/widget1.ui ${config}) + uic_incremental_build_test(incremental_build_test ${RunCMake_BINARY_DIR}/incremental_build${config_desc}-build + ${RunCMake_SOURCE_DIR}/incremental_build ${config}) - uic_build_test(multi_ui_files_touch_cpp ${RunCMake_BINARY_DIR}/multi_ui_files_touch_cpp${config_desc}-build - ${RunCMake_SOURCE_DIR}/multi_ui_files ${RunCMake_SOURCE_DIR}/multi_ui_files/src/widget1.cpp ${config}) endforeach() endif() endif() diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/CMakeLists.txt b/Tests/RunCMake/Autogen_6/incremental_build/CMakeLists.txt similarity index 68% rename from Tests/RunCMake/Autogen_6/multi_ui_files/CMakeLists.txt rename to Tests/RunCMake/Autogen_6/incremental_build/CMakeLists.txt index a4f720639..1796b8f11 100644 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/CMakeLists.txt +++ b/Tests/RunCMake/Autogen_6/incremental_build/CMakeLists.txt @@ -8,16 +8,10 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) add_executable(example - src/mainwindow.ui - src/widget1.ui - src/widget2.ui - src/mainwindow.h - src/widget1.h - src/widget2.h - src/main.cpp - src/mainwindow.cpp - src/widget1.cpp - src/widget2.cpp + main.cpp + ui/widget.cpp + ui/widget.h + ui/widget.ui ) target_link_libraries(example PRIVATE Qt${with_qt_version}::Widgets diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/main.cpp b/Tests/RunCMake/Autogen_6/incremental_build/main.cpp similarity index 75% rename from Tests/RunCMake/Autogen_6/multi_ui_files/src/main.cpp rename to Tests/RunCMake/Autogen_6/incremental_build/main.cpp index 8d76ad99f..c15abe4d2 100644 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/main.cpp +++ b/Tests/RunCMake/Autogen_6/incremental_build/main.cpp @@ -1,11 +1,11 @@ #include -#include "mainwindow.h" +#include "ui/widget.h" int main(int argc, char* argv[]) { QApplication a(argc, argv); - MainWindow w; + Widget w; w.show(); return a.exec(); } diff --git a/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.cpp b/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.cpp new file mode 100644 index 000000000..4de4ed2fd --- /dev/null +++ b/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.cpp @@ -0,0 +1,15 @@ +#include "widget.h" + +#include "./ui_widget.h" + +Widget::Widget(QWidget* parent) + : QWidget(parent) + , ui(new Ui::Widget) +{ + ui->setupUi(this); +} + +Widget::~Widget() +{ + delete ui; +} diff --git a/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.h b/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.h new file mode 100644 index 000000000..2243ffe98 --- /dev/null +++ b/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.h @@ -0,0 +1,23 @@ +#ifndef WIDGET_H +#define WIDGET_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { +class Widget; +} +QT_END_NAMESPACE + +class Widget : public QWidget +{ + Q_OBJECT + +public: + Widget(QWidget* parent = nullptr); + ~Widget(); + +private: + Ui::Widget* ui; +}; +#endif // WIDGET_H diff --git a/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.ui b/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.ui new file mode 100644 index 000000000..b90248d13 --- /dev/null +++ b/Tests/RunCMake/Autogen_6/incremental_build/ui/widget.ui @@ -0,0 +1,19 @@ + + + Widget + + + + 0 + 0 + 800 + 600 + + + + Widget + + + + + diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.cpp b/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.cpp deleted file mode 100644 index eb3d3669d..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "mainwindow.h" - -#include - -#include "src/ui_mainwindow.h" -#include "widget1.h" - -MainWindow::MainWindow(QWidget* parent) - : QMainWindow(parent) - , ui(new Ui::MainWindow) -{ - ui->setupUi(this); - auto layout = new QVBoxLayout; - layout->addWidget(new Widget1); - - QWidget* w = new QWidget(this); - w->setLayout(layout); - - setCentralWidget(w); -} - -MainWindow::~MainWindow() -{ - delete ui; -} diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.h b/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.h deleted file mode 100644 index 3e6445964..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE -namespace Ui { -class MainWindow; -} -QT_END_NAMESPACE - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - MainWindow(QWidget* parent = nullptr); - ~MainWindow(); - -private: - Ui::MainWindow* ui; -}; -#endif // MAINWINDOW_H diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.ui b/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.ui deleted file mode 100644 index 828d7c178..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/mainwindow.ui +++ /dev/null @@ -1,33 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - 0 - 0 - 800 - 22 - - - - - - - - diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.cpp b/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.cpp deleted file mode 100644 index 05657ce62..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "widget1.h" - -#include "src/ui_widget1.h" - -Widget1::Widget1(QWidget* parent) - : QWidget(parent) - , ui(new Ui::Widget1) -{ - ui->setupUi(this); - connect(ui->lineEdit, SIGNAL(textChanged(const QString&)), this, - SLOT(onTextChanged(const QString&))); -} - -Widget1::~Widget1() -{ - delete ui; -} - -void Widget1::onTextChanged(const QString& text) -{ - ui->OnTextChanged->setText(text); -} diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.h b/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.h deleted file mode 100644 index 8c28d6deb..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef WIDGET1_H -#define WIDGET1_H - -#include - -namespace Ui { -class Widget1; -} - -class Widget1 : public QWidget -{ - Q_OBJECT -public: - explicit Widget1(QWidget* parent = nullptr); - ~Widget1(); -public slots: - void onTextChanged(const QString& text); - -private: - Ui::Widget1* ui; -}; - -#endif // WIDGET1_H diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.ui b/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.ui deleted file mode 100644 index db0c58d5d..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget1.ui +++ /dev/null @@ -1,52 +0,0 @@ - - - Widget1 - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - Input: - - - - - - - - - - OnTextChanged: - - - - - - - - - - - - - - TextLabel - - - - - - - - diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.cpp b/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.cpp deleted file mode 100644 index 7f4bbafce..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "widget2.h" - -#include "src/ui_widget2.h" - -Widget2::Widget2(QWidget* parent) - : QWidget(parent) - , ui(new Ui::Widget2) -{ - ui->setupUi(this); - connect(ui->lineEdit, SIGNAL(textChanged(const QString&)), this, - SLOT(onTextChanged(const QString&))); -} - -Widget2::~Widget2() -{ - delete ui; -} - -void Widget2::onTextChanged(const QString& text) -{ - ui->OnTextChanged->setText(text); -} diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.h b/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.h deleted file mode 100644 index 41d7e1fd0..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef WIDGET2_H -#define WIDGET2_H - -#include - -namespace Ui { -class Widget2; -} - -class Widget2 : public QWidget -{ - Q_OBJECT - -public: - explicit Widget2(QWidget* parent = nullptr); - ~Widget2(); -public slots: - void onTextChanged(const QString& text); - -private: - Ui::Widget2* ui; -}; - -#endif // WIDGET2_H diff --git a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.ui b/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.ui deleted file mode 100644 index facf4678f..000000000 --- a/Tests/RunCMake/Autogen_6/multi_ui_files/src/widget2.ui +++ /dev/null @@ -1,45 +0,0 @@ - - - Widget2 - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - Input: - - - - - - - - - - OnTextChanged: - - - - - - - - - - - - - - - diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake index a79fcaf94..5abea2537 100644 --- a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake +++ b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake @@ -19,6 +19,10 @@ run_cmake_with_options(TARGET_FILE_BASE_NAME -DCMAKE_BUILD_TYPE:STRING=Debug) run_cmake_with_options(TARGET_FILE_BASE_NAME-imported-target -DCMAKE_BUILD_TYPE:STRING=Debug) run_cmake(TARGET_FILE_BASE_NAME-non-valid-target) run_cmake(TARGET_LINKER_FILE_BASE_NAME-non-valid-target) +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "AIX") + run_cmake(TARGET_SONAME_FILE-AIX) + run_cmake(TARGET_SONAME_IMPORT_FILE-AIX) +endif() run_cmake(NonValidTarget-TARGET_BUNDLE_DIR) run_cmake(NonValidTarget-TARGET_BUNDLE_DIR_NAME) run_cmake(NonValidTarget-TARGET_BUNDLE_CONTENT_DIR) diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX-stderr.txt new file mode 100644 index 000000000..f440662b6 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at TARGET_SONAME_FILE-AIX\.cmake:[0-9]+ \(add_custom_target\): + Error evaluating generator expression: + + \$ + + TARGET_SONAME_FILE is not allowed for AIX_SHARED_LIBRARY_ARCHIVE libraries\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX.cmake new file mode 100644 index 000000000..c64128379 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_FILE-AIX.cmake @@ -0,0 +1,4 @@ +enable_language (C) +set(CMAKE_AIX_SHARED_LIBRARY_ARCHIVE 1) +add_library(sla SHARED empty.c) +add_custom_target(custom COMMAND ${CMAKE_COMMAND} -E echo "$") diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX-stderr.txt new file mode 100644 index 000000000..41c7df16d --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at TARGET_SONAME_IMPORT_FILE-AIX\.cmake:[0-9]+ \(add_custom_target\): + Error evaluating generator expression: + + \$ + + TARGET_SONAME_IMPORT_FILE is not allowed for AIX_SHARED_LIBRARY_ARCHIVE + libraries\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX.cmake new file mode 100644 index 000000000..b3f89a3f8 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_SONAME_IMPORT_FILE-AIX.cmake @@ -0,0 +1,4 @@ +enable_language (C) +set(CMAKE_AIX_SHARED_LIBRARY_ARCHIVE 1) +add_library(sla SHARED empty.c) +add_custom_target(custom COMMAND ${CMAKE_COMMAND} -E echo "$") diff --git a/Tests/RunCMake/RuntimePath/Stub-fail-stderr.txt b/Tests/RunCMake/RuntimePath/Stub-fail-stderr.txt index 9c17414d4..38cd1190e 100644 --- a/Tests/RunCMake/RuntimePath/Stub-fail-stderr.txt +++ b/Tests/RunCMake/RuntimePath/Stub-fail-stderr.txt @@ -1 +1 @@ -(error while loading shared libraries: libStub\.so\.1|Library not loaded: '?@rpath/libStub\.1\.dylib'?|(Cannot|Could not) load module libStub\.so|fatal: libStub\.so\.1: open failed|Shared object "libStub\.so\.1" not found) +(error while loading shared libraries: libStub\.so\.1|Library not loaded: '?@rpath/libStub\.1\.dylib'?|(Cannot|Could not) load module libStub\.a\(libStub\.so\.1\)|fatal: libStub\.so\.1: open failed|Shared object "libStub\.so\.1" not found) diff --git a/Tests/RunCMake/RuntimePath/Stub.cmake b/Tests/RunCMake/RuntimePath/Stub.cmake index 18e99c15a..6ab9312b2 100644 --- a/Tests/RunCMake/RuntimePath/Stub.cmake +++ b/Tests/RunCMake/RuntimePath/Stub.cmake @@ -1,5 +1,15 @@ enable_language(C) +set(CMAKE_AIX_SHARED_LIBRARY_ARCHIVE 1) + +if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set(suffix "${CMAKE_SHARED_LIBRARY_ARCHIVE_SUFFIX}") + set(genex "TARGET_LINKER_FILE") +else() + set(suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(genex "TARGET_SONAME_FILE") +endif() + add_library(Stub SHARED Stub.c) set_target_properties(Stub PROPERTIES SOVERSION 1 @@ -7,10 +17,10 @@ set_target_properties(Stub PROPERTIES ) set(StubDir ${CMAKE_CURRENT_BINARY_DIR}/lib/stubs) -set(Stub "${StubDir}/${CMAKE_SHARED_LIBRARY_PREFIX}Stub${CMAKE_SHARED_LIBRARY_SUFFIX}") +set(Stub "${StubDir}/${CMAKE_SHARED_LIBRARY_PREFIX}Stub${suffix}") add_custom_target(StubCopy COMMAND ${CMAKE_COMMAND} -E make_directory "${StubDir}" - COMMAND ${CMAKE_COMMAND} -E copy "$" "${Stub}" + COMMAND ${CMAKE_COMMAND} -E copy "$<${genex}:Stub>" "${Stub}" BYPRODUCTS ${Stub} ) add_dependencies(StubCopy Stub) diff --git a/Tests/RunCMake/target_link_options/LINKER_expansion.cmake b/Tests/RunCMake/target_link_options/LINKER_expansion.cmake index 221921897..7a2ffa106 100644 --- a/Tests/RunCMake/target_link_options/LINKER_expansion.cmake +++ b/Tests/RunCMake/target_link_options/LINKER_expansion.cmake @@ -26,6 +26,7 @@ endfunction() # Use LINKER alone add_test_library(linker) target_link_options(linker PRIVATE "LINKER:-foo,bar") +target_link_options(linker PRIVATE "LINKER:") # empty # Use LINKER with SHELL add_test_library(linker_shell) diff --git a/Tests/SharedLibraryArchive/CMakeLists.txt b/Tests/SharedLibraryArchive/CMakeLists.txt index f6bef2434..cc961f1b3 100644 --- a/Tests/SharedLibraryArchive/CMakeLists.txt +++ b/Tests/SharedLibraryArchive/CMakeLists.txt @@ -36,3 +36,9 @@ if(aix_sla_versioned) message(FATAL_ERROR "AIX_SHARED_LIBRARY_ARCHIVE initialized on EXECUTABLE") endif() target_link_libraries(UseSLA_versioned PRIVATE sla_versioned) + +add_library(imported SHARED IMPORTED) +get_property(aix_sla TARGET imported PROPERTY AIX_SHARED_LIBRARY_ARCHIVE) +if(aix_sla) + message(FATAL_ERROR "AIX_SHARED_LIBRARY_ARCHIVE initialized on imported target") +endif()