[Cmake-commits] CMake branch, next, updated. v3.6.2-2578-g9f26f85
Brad King
brad.king at kitware.com
Wed Sep 28 10:35:53 EDT 2016
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, next has been updated
via 9f26f85fc82352486088c5820345ac7928f08468 (commit)
via 9c5238dfd6a3aa1d7e0ba30f302e75ffbc893851 (commit)
via 40c0482153b54f60cd2f2e573cc1183df56e8a76 (commit)
from be4409380f0aea73c6816554fd8c7228a65a527f (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=9f26f85fc82352486088c5820345ac7928f08468
commit 9f26f85fc82352486088c5820345ac7928f08468
Merge: be44093 9c5238d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 28 10:35:50 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Sep 28 10:35:50 2016 -0400
Merge topic 'fix-explicit-RC' into next
9c5238df project: Fix support for explicit RC language
40c04821 Tests: Decide earlier whether to test resources
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c5238dfd6a3aa1d7e0ba30f302e75ffbc893851
commit 9c5238dfd6a3aa1d7e0ba30f302e75ffbc893851
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 27 09:33:58 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 28 10:34:57 2016 -0400
project: Fix support for explicit RC language
The check added in commit v3.6.0-rc1~293^2 (Diagnose recursive
project/enable_language without crashing, 2016-03-07) broke support for
enabling `RC` explicitly along with other languages like `C`. The
reason is that we enable all listed languages at once so the internal
`enable_language(RC)` that we do while enabling `C` or `CXX` on some
platforms triggers the recursion check if `RC` is explicitly listed.
Ideally we should refactor things to only enable one language at a time,
but for now it is simplest to just exclude `RC` from the explicit list
until other languages are enabled, and then enable it.
Closes: #16330
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 48e6c61..df993ce 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3142,7 +3142,26 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& lang,
{
this->AddDefinition("CMAKE_CFG_INTDIR",
this->GetGlobalGenerator()->GetCMakeCFGIntDir());
- this->GetGlobalGenerator()->EnableLanguage(lang, this, optional);
+ // If RC is explicitly listed we need to do it after other languages.
+ // On some platforms we enable RC implicitly while enabling others.
+ // Do not let that look like recursive enable_language(RC).
+ std::vector<std::string> langs;
+ std::vector<std::string> langsRC;
+ langs.reserve(lang.size());
+ for (std::vector<std::string>::const_iterator i = lang.begin();
+ i != lang.end(); ++i) {
+ if (i->compare("RC") == 0) {
+ langsRC.push_back(*i);
+ } else {
+ langs.push_back(*i);
+ }
+ }
+ if (!langs.empty()) {
+ this->GetGlobalGenerator()->EnableLanguage(langs, this, optional);
+ }
+ if (!langsRC.empty()) {
+ this->GetGlobalGenerator()->EnableLanguage(langsRC, this, optional);
+ }
}
int cmMakefile::TryCompile(const std::string& srcdir,
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 778982f..0eafbef 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -207,7 +207,7 @@ add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(list)
add_RunCMake_test(message)
-add_RunCMake_test(project)
+add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES})
add_RunCMake_test(return)
add_RunCMake_test(set_property)
add_RunCMake_test(string)
diff --git a/Tests/RunCMake/project/ExplicitRC.cmake b/Tests/RunCMake/project/ExplicitRC.cmake
new file mode 100644
index 0000000..b3feaa9
--- /dev/null
+++ b/Tests/RunCMake/project/ExplicitRC.cmake
@@ -0,0 +1 @@
+project(ExplicitRC C RC)
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index 6ab0fc9..dba97d2 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
include(RunCMake)
+if(CMake_TEST_RESOURCES)
+ run_cmake(ExplicitRC)
+endif()
run_cmake(LanguagesImplicit)
run_cmake(LanguagesEmpty)
run_cmake(LanguagesNONE)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40c0482153b54f60cd2f2e573cc1183df56e8a76
commit 40c0482153b54f60cd2f2e573cc1183df56e8a76
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 27 08:38:18 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 28 09:40:00 2016 -0400
Tests: Decide earlier whether to test resources
Provide a CMake_TEST_RESOURCES variable storing the decision.
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 3681843..c056fb8 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -83,6 +83,17 @@ if(BUILD_TESTING)
set(MAKE_SUPPORTS_SPACES 0)
endif()
+ # assume no resources building to test
+ set(CMake_TEST_RESOURCES FALSE)
+ # for windows and cygwin assume we have resources
+ if(WIN32 OR CYGWIN)
+ set(CMake_TEST_RESOURCES TRUE)
+ endif()
+ # for borland and watcom there is no resource support
+ if(WATCOM OR BORLAND)
+ set(CMake_TEST_RESOURCES FALSE)
+ endif()
+
set(build_generator_args
--build-generator ${CMAKE_GENERATOR}
)
@@ -262,17 +273,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(CompileFeatures CompileFeatures)
ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features)
- # assume no resources building to test
- set(TEST_RESOURCES FALSE)
- # for windows and cygwin assume we have resources
- if(WIN32 OR CYGWIN)
- set(TEST_RESOURCES TRUE)
- endif()
- # for borland and watcom there is no resource support
- if(WATCOM OR BORLAND)
- set(TEST_RESOURCES FALSE)
- endif()
- if(TEST_RESOURCES)
+ if(CMake_TEST_RESOURCES)
ADD_TEST_MACRO(VSResource VSResource)
if (CMAKE_GENERATOR MATCHES "Ninja")
add_test_macro(VSResourceNinjaForceRSP VSResourceNinjaForceRSP)
-----------------------------------------------------------------------
Summary of changes:
Source/cmMakefile.cxx | 21 ++++++++++++++++++++-
Tests/CMakeLists.txt | 23 ++++++++++++-----------
Tests/RunCMake/CMakeLists.txt | 2 +-
Tests/RunCMake/project/ExplicitRC.cmake | 1 +
Tests/RunCMake/project/RunCMakeTest.cmake | 3 +++
5 files changed, 37 insertions(+), 13 deletions(-)
create mode 100644 Tests/RunCMake/project/ExplicitRC.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list