diff options
-rw-r--r-- | Help/prop_tgt/SOVERSION.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/VERSION.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt | 9 | ||||
-rw-r--r-- | Help/release/3.28.rst | 4 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 40 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 1 | ||||
-rw-r--r-- | Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity-check.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake | 1 |
11 files changed, 37 insertions, 37 deletions
diff --git a/Help/prop_tgt/SOVERSION.rst b/Help/prop_tgt/SOVERSION.rst index b377f22..4f8b1b5 100644 --- a/Help/prop_tgt/SOVERSION.rst +++ b/Help/prop_tgt/SOVERSION.rst @@ -1,15 +1,17 @@ SOVERSION --------- -What version number is this target. +ABI version number of a shared library target. For shared libraries :prop_tgt:`VERSION` and ``SOVERSION`` can be used to -specify the build version and API version respectively. When building or +specify the build version and ABI version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. ``SOVERSION`` is ignored if :prop_tgt:`NO_SONAME` property is set. +.. include:: VERSION_SOVERSION_EXAMPLE.txt + Windows Versions ^^^^^^^^^^^^^^^^ diff --git a/Help/prop_tgt/VERSION.rst b/Help/prop_tgt/VERSION.rst index 95db483..f9cb020 100644 --- a/Help/prop_tgt/VERSION.rst +++ b/Help/prop_tgt/VERSION.rst @@ -1,10 +1,10 @@ VERSION ------- -What version number is this target. +Version number of a shared library target. For shared libraries ``VERSION`` and :prop_tgt:`SOVERSION` can be used -to specify the build version and API version respectively. When building or +to specify the build version and ABI version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. For @@ -12,6 +12,8 @@ executables ``VERSION`` can be used to specify the build version. When building or installing appropriate symlinks are created if the platform supports symlinks. +.. include:: VERSION_SOVERSION_EXAMPLE.txt + Windows Versions ^^^^^^^^^^^^^^^^ diff --git a/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt b/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt new file mode 100644 index 0000000..ff2a958 --- /dev/null +++ b/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt @@ -0,0 +1,9 @@ +A common convention is to specify both ``VERSION`` and ``SOVERSION`` +such that ``SOVERSION`` matches the first component of ``VERSION``: + +.. code-block:: cmake + + set_target_properties(mylib PROPERTIES VERSION 1.2.3 SOVERSION 1) + +The idea is that breaking changes to the ABI increment both the +``SOVERSION`` and the major ``VERSION`` number. diff --git a/Help/release/3.28.rst b/Help/release/3.28.rst index 05918ec..166bed9 100644 --- a/Help/release/3.28.rst +++ b/Help/release/3.28.rst @@ -201,8 +201,8 @@ Updates Changes made since CMake 3.28.0 include the following. -3.28.1, 3.28.2 --------------- +3.28.1, 3.28.2, 3.28.3 +---------------------- * These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c34a2f0..4f4403b 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 28) -set(CMake_VERSION_PATCH 20240202) +set(CMake_VERSION_PATCH 20240205) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8a07073..71ab2a6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1568,10 +1568,7 @@ bool cmGlobalGenerator::Compute() // so create the map from project name to vector of local generators this->FillProjectMap(); - // Add automatically generated sources (e.g. unity build). - if (!this->AddAutomaticSources()) { - return false; - } + this->CreateFileGenerateOutputs(); // Iterate through all targets and add verification targets for header sets if (!this->AddHeaderSetVerification()) { @@ -1612,10 +1609,11 @@ bool cmGlobalGenerator::Compute() } } + // Add automatically generated sources (e.g. unity build). // Add unity sources after computing compile features. Unity sources do // not change the set of languages or features, but we need to know them // to filter out sources that are scanned for C++ module dependencies. - if (!this->AddUnitySources()) { + if (!this->AddAutomaticSources()) { return false; } @@ -1885,16 +1883,21 @@ bool cmGlobalGenerator::AddHeaderSetVerification() return true; } -bool cmGlobalGenerator::AddAutomaticSources() +void cmGlobalGenerator::CreateFileGenerateOutputs() { for (const auto& lg : this->LocalGenerators) { lg->CreateEvaluationFileOutputs(); } +} + +bool cmGlobalGenerator::AddAutomaticSources() +{ for (const auto& lg : this->LocalGenerators) { for (const auto& gt : lg->GetGeneratorTargets()) { if (!gt->CanCompileSources()) { continue; } + lg->AddUnityBuild(gt.get()); lg->AddISPCDependencies(gt.get()); // Targets that reuse a PCH are handled below. if (!gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) { @@ -1914,29 +1917,8 @@ bool cmGlobalGenerator::AddAutomaticSources() } } } - // The above transformations may have changed the classification of sources. - // Clear the source list and classification cache (KindedSources) of all - // targets so that it will be recomputed correctly by the generators later - // now that the above transformations are done for all targets. - for (const auto& lg : this->LocalGenerators) { - for (const auto& gt : lg->GetGeneratorTargets()) { - gt->ClearSourcesCache(); - } - } - return true; -} - -bool cmGlobalGenerator::AddUnitySources() -{ - for (const auto& lg : this->LocalGenerators) { - for (const auto& gt : lg->GetGeneratorTargets()) { - if (!gt->CanCompileSources()) { - continue; - } - lg->AddUnityBuild(gt.get()); - } - } - // The above transformation may have changed the classification of sources. + // The above transformations may have changed the classification of sources, + // e.g., sources that go into unity builds become SourceKindUnityBatched. // Clear the source list and classification cache (KindedSources) of all // targets so that it will be recomputed correctly by the generators later // now that the above transformations are done for all targets. diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index b1ce323..ba39768 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -678,8 +678,8 @@ protected: bool AddHeaderSetVerification(); + void CreateFileGenerateOutputs(); bool AddAutomaticSources(); - bool AddUnitySources(); std::string SelectMakeProgram(const std::string& makeProgram, const std::string& makeDefault = "") const; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ab1de4f..e7fa717 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -3207,6 +3207,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target) for (size_t ci = 0; ci < configs.size(); ++ci) { // FIXME: Refactor collection of sources to not evaluate object libraries. + // Their final set of object files might be transformed by unity builds. std::vector<cmSourceFile*> sources; target->GetSourceFiles(sources, configs[ci]); for (cmSourceFile* sf : sources) { diff --git a/Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity-check.cmake new file mode 100644 index 0000000..c17aaa0 --- /dev/null +++ b/Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity-check.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/PchInterface-check.cmake) diff --git a/Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity.cmake b/Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity.cmake new file mode 100644 index 0000000..59c2523 --- /dev/null +++ b/Tests/RunCMake/PrecompileHeaders/PchInterfaceUnity.cmake @@ -0,0 +1,2 @@ +set(CMAKE_UNITY_BUILD 1) +include(PchInterface.cmake) diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake index b163369..c8a5c15 100644 --- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake +++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake @@ -12,6 +12,7 @@ endfunction() run_cmake(DisabledPch) run_cmake(PchDebugGenex) run_test(PchInterface) +run_test(PchInterfaceUnity) run_cmake(PchPrologueEpilogue) run_test(SkipPrecompileHeaders) run_test(CXXnotC) |