[Cmake-commits] CMake branch, master, updated. v3.16.0-rc2-96-g61c6d49f5a
Kitware Robot
kwrobot at kitware.com
Mon Oct 21 11:20:17 EDT 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 61c6d49f5a2f3024aca81bb1535ab804f94adfba (commit)
via 50afd147f851aec03e203f2e8c413ab8a9e744c5 (commit)
via c684db4ea8d4763a7a70582d24c4bf5ac14cfea4 (commit)
via 55a0bebdd3d253f81bd89782702d481ac81110b3 (commit)
via bcaecf6bcddfaec2b586bff870650a4a66b0ccc3 (commit)
via 324988a6b101f29d148badc32b44964aedae1163 (commit)
via fd2c9fac101ec6d341db5b30e9d1eba64fa23116 (commit)
from a82a96f35b3970501cd552c36819f9313734f669 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61c6d49f5a2f3024aca81bb1535ab804f94adfba
commit 61c6d49f5a2f3024aca81bb1535ab804f94adfba
Merge: 50afd147f8 c684db4ea8
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 21 15:19:37 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 21 11:19:45 2019 -0400
Merge topic 'doc-genex-tweak'
c684db4ea8 Help: Fix COMPILE_LANG_AND_ID genex example
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3939
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50afd147f851aec03e203f2e8c413ab8a9e744c5
commit 50afd147f851aec03e203f2e8c413ab8a9e744c5
Merge: a82a96f35b 55a0bebdd3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 21 15:11:58 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 21 11:12:06 2019 -0400
Merge topic 'vs-per-config-sources'
55a0bebdd3 VS: Add support for per-config sources
bcaecf6bcd Teach check for single-language targets to consider all configurations
324988a6b1 cmGeneratorTarget: Add GetAllConfigCompileLanguages method
fd2c9fac10 cmGeneratorTarget: Return non-const sources from GetAllConfigSources
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3882
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c684db4ea8d4763a7a70582d24c4bf5ac14cfea4
commit c684db4ea8d4763a7a70582d24c4bf5ac14cfea4
Author: Alan W. Irwin <irwin at beluga.phys.uvic.ca>
AuthorDate: Mon Oct 21 10:21:16 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 21 10:25:41 2019 -0400
Help: Fix COMPILE_LANG_AND_ID genex example
Fix the `COMPILE_LANGUAGE/CXX_COMPILER_ID` variant of the example to
have the same meaning as the `COMPILE_LANG_AND_ID` variant. The
inconsistency was introduced by commit 808b818063 (Genex: CompileLang
and CompileLangAndId now match against a list of ids, 2019-05-30,
v3.15.0-rc1~11^2~1).
Fixes: #19862
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index c0449fb4ae..e970379fad 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -195,7 +195,7 @@ Variable Queries
.. code-block:: cmake
target_compile_definitions(myapp
- PRIVATE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Clang>>:COMPILING_CXX_WITH_CLANG>
+ PRIVATE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:AppleClang,Clang>>:COMPILING_CXX_WITH_CLANG>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Intel>>:COMPILING_CXX_WITH_INTEL>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:Clang>>:COMPILING_C_WITH_CLANG>
)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55a0bebdd3d253f81bd89782702d481ac81110b3
commit 55a0bebdd3d253f81bd89782702d481ac81110b3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 2 13:59:15 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 17 14:05:39 2019 -0400
VS: Add support for per-config sources
Since commit 97cc29c766 (VS: Teach generators how to mark per-config
source files, 2017-04-10, v3.9.0-rc1~268^2~2) the VS generators have
known how to generate per-config sources. We've now converted most
other code paths to support per-config sources, so drop the check
that disallows it.
This leaves only per-config support for precompiled headers and unity
build transformations, but those are optional features that can be
addressed later.
Fixes: #18233
Issue: #19789
diff --git a/Help/release/dev/vs-per-config-sources.rst b/Help/release/dev/vs-per-config-sources.rst
new file mode 100644
index 0000000000..bf7572b6ed
--- /dev/null
+++ b/Help/release/dev/vs-per-config-sources.rst
@@ -0,0 +1,5 @@
+vs-per-config-sources
+---------------------
+
+* :ref:`Visual Studio Generators` learned to support per-config sources.
+ Previously only :ref:`Command-Line Build Tool Generators` supported them.
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 6569e5ef61..54124070d7 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -799,15 +799,6 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
cmGeneratorTarget const* gt)
{
- // check to see if this is a fortran build
- {
- // Issue diagnostic if the source files depend on the config.
- std::vector<cmSourceFile*> sources;
- if (!gt->GetConfigCommonSourceFiles(sources)) {
- return false;
- }
- }
-
// If there's only one source language, Fortran has to be used
// in order for the sources to compile.
std::set<std::string> languages = gt->GetAllConfigCompileLanguages();
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b29638bafe..185401fc43 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -451,8 +451,12 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
ADD_TEST_MACRO(ImportedSameName ImportedSameName)
ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
- if(NOT _isMultiConfig)
- set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ if(_isMultiConfig)
+ set(ConfigSources_CTEST_OPTIONS --build-config $<CONFIGURATION>)
+ else()
+ set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ endif()
ADD_TEST_MACRO(ConfigSources ConfigSources)
endif()
ADD_TEST_MACRO(SourcesProperty SourcesProperty)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index bee8c4e38f..0d462ba66c 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -1,6 +1,6 @@
include(RunCMake)
-if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+if(RunCMake_GENERATOR STREQUAL "Xcode")
run_cmake(ConfigNotAllowed)
endif()
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcaecf6bcddfaec2b586bff870650a4a66b0ccc3
commit bcaecf6bcddfaec2b586bff870650a4a66b0ccc3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 4 10:42:03 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 17 14:03:54 2019 -0400
Teach check for single-language targets to consider all configurations
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0cc70c7d8b..d5e58b0062 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -6356,8 +6356,7 @@ bool cmGeneratorTarget::IsCSharpOnly() const
this->GetType() != cmStateEnums::EXECUTABLE) {
return false;
}
- std::set<std::string> languages;
- this->GetLanguages(languages, "");
+ std::set<std::string> languages = this->GetAllConfigCompileLanguages();
// Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets.
const char* linkLang = this->GetProperty("LINKER_LANGUAGE");
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ed0cba7ddf..6569e5ef61 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -810,8 +810,7 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
// If there's only one source language, Fortran has to be used
// in order for the sources to compile.
- std::set<std::string> languages;
- gt->GetLanguages(languages, "");
+ std::set<std::string> languages = gt->GetAllConfigCompileLanguages();
// Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets.
// This allows the project to control the language choice in
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=324988a6b101f29d148badc32b44964aedae1163
commit 324988a6b101f29d148badc32b44964aedae1163
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 2 13:57:12 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 17 14:03:54 2019 -0400
cmGeneratorTarget: Add GetAllConfigCompileLanguages method
Return all languages needed to compile sources in the target in
any configuration.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 949d9d9128..0cc70c7d8b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1670,6 +1670,19 @@ void cmGeneratorTarget::ComputeAllConfigSources() const
}
}
+std::set<std::string> cmGeneratorTarget::GetAllConfigCompileLanguages() const
+{
+ std::set<std::string> languages;
+ std::vector<AllConfigSource> const& sources = this->GetAllConfigSources();
+ for (AllConfigSource const& si : sources) {
+ std::string const& lang = si.Source->GetOrDetermineLanguage();
+ if (!lang.empty()) {
+ languages.emplace(lang);
+ }
+ }
+ return languages;
+}
+
std::string cmGeneratorTarget::GetCompilePDBName(
const std::string& config) const
{
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index c2811b2e84..4623513140 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -132,6 +132,10 @@ public:
per-source configurations assigned. */
std::vector<AllConfigSource> const& GetAllConfigSources() const;
+ /** Get all languages used to compile sources in any configuration.
+ This excludes the languages of objects from object libraries. */
+ std::set<std::string> GetAllConfigCompileLanguages() const;
+
void GetObjectSources(std::vector<cmSourceFile const*>&,
const std::string& config) const;
const std::string& GetObjectName(cmSourceFile const* file);
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd2c9fac101ec6d341db5b30e9d1eba64fa23116
commit fd2c9fac101ec6d341db5b30e9d1eba64fa23116
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 2 13:48:37 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 17 14:03:54 2019 -0400
cmGeneratorTarget: Return non-const sources from GetAllConfigSources
We need a non-const pointer to `cmSourceFile` instances in order to
call `GetOrDetermineLanguage` on them.
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 1f824b1163..c2811b2e84 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -123,7 +123,7 @@ public:
struct AllConfigSource
{
- cmSourceFile const* Source;
+ cmSourceFile* Source;
cmGeneratorTarget::SourceKind Kind;
std::vector<size_t> Configs;
};
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ff1eaec935..fd346df685 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1329,7 +1329,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
// Add CMakeLists.txt file with rule to re-run CMake for user convenience.
if (target->GetType() != cmStateEnums::GLOBAL_TARGET &&
target->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
- if (cmSourceFile const* sf = this->CreateVCProjBuildRule()) {
+ if (cmSourceFile* sf = this->CreateVCProjBuildRule()) {
cmGeneratorTarget::AllConfigSource acs;
acs.Source = sf;
acs.Kind = cmGeneratorTarget::SourceKindCustomCommand;
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-generator-expressions.7.rst | 2 +-
Help/release/dev/vs-per-config-sources.rst | 5 +++++
Source/cmGeneratorTarget.cxx | 16 ++++++++++++++--
Source/cmGeneratorTarget.h | 6 +++++-
Source/cmGlobalVisualStudioGenerator.cxx | 12 +-----------
Source/cmLocalVisualStudio7Generator.cxx | 2 +-
Tests/CMakeLists.txt | 8 ++++++--
Tests/RunCMake/TargetSources/RunCMakeTest.cmake | 2 +-
8 files changed, 34 insertions(+), 19 deletions(-)
create mode 100644 Help/release/dev/vs-per-config-sources.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list