[Cmake-commits] CMake branch, next, updated. v3.6.2-2550-g31e7e33
Brad King
brad.king at kitware.com
Tue Sep 27 09:51:07 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 31e7e337941e817c63de9d32972afd9d6cd17eed (commit)
via bc8145d21f9ce7246459774af4a9bd8c812c286b (commit)
via 247c290af678ddb4e8d138c795e912539970dc3f (commit)
via 2136775e1ffbd2ccf9b355181d58fa594eb2b2d3 (commit)
from 29c433076f24abce950e4b5c6e8eca90cbd21bd6 (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=31e7e337941e817c63de9d32972afd9d6cd17eed
commit 31e7e337941e817c63de9d32972afd9d6cd17eed
Merge: 29c4330 bc8145d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 27 09:51:05 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Sep 27 09:51:05 2016 -0400
Merge topic 'fix-explicit-RC' into next
bc8145d2 project: Fix support for explicit RC language
247c290a enable_language: Add option for CMake-internal calls
2136775e Tests: Decide earlier whether to test resources
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc8145d21f9ce7246459774af4a9bd8c812c286b
commit bc8145d21f9ce7246459774af4a9bd8c812c286b
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: Tue Sep 27 09:40:59 2016 -0400
project: Fix support for explicit RC language
Since commit v3.6.0-rc1~293^2 (Diagnose recursive
project/enable_language without crashing, 2016-03-07) we do not allow a
language to be enabled by code involved in enabling it. Tell our
internal implementation about when one language enables another so that
we do not falsely diagnose the internal `enable_language(RC)` calls as
recursive when the calling `project()` command explicitly lists RC.
Closes: #16330
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 5090c08..0d11209 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -57,5 +57,5 @@ macro(__cygwin_compiler_gnu lang)
set(CMAKE_RC_COMPILER_INIT windres)
endif()
- enable_language(RC)
+ enable_language(RC __CMAKE_INTERNAL)
endmacro()
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index d8a423e..7632d52 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -142,7 +142,7 @@ macro(__windows_compiler_gnu lang)
set(CMAKE_RC_COMPILER_INIT windres)
endif()
- enable_language(RC)
+ enable_language(RC __CMAKE_INTERNAL)
endmacro()
macro(__windows_compiler_gnu_abi lang)
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 723c69e..319eeab 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -317,6 +317,6 @@ macro(__windows_compiler_msvc lang)
string(APPEND CMAKE_RC_FLAGS_INIT " ${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_${lang}}")
endif()
- enable_language(RC)
+ enable_language(RC __CMAKE_INTERNAL)
set(CMAKE_NINJA_CMCLDEPS_RC 1)
endmacro()
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index fc02800..aee707b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -380,11 +380,12 @@ void cmGlobalGenerator::EnableLanguage(
return;
}
- static_cast<void>(internal);
- std::set<std::string> cur_languages(languages.begin(), languages.end());
- for (std::set<std::string>::iterator li = cur_languages.begin();
- li != cur_languages.end(); ++li) {
- if (!this->LanguagesInProgress.insert(*li).second) {
+ std::set<std::string> cur_languages;
+ for (std::vector<std::string>::const_iterator li = languages.begin();
+ li != languages.end(); ++li) {
+ if (this->LanguagesInProgress.insert(*li).second) {
+ cur_languages.insert(*li);
+ } else if (!internal) {
std::ostringstream e;
e << "Language '" << *li << "' is currently being enabled. "
"Recursive call not allowed.";
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=247c290af678ddb4e8d138c795e912539970dc3f
commit 247c290af678ddb4e8d138c795e912539970dc3f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 27 09:32:43 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 27 09:36:49 2016 -0400
enable_language: Add option for CMake-internal calls
Some of our platform information files call `enable_language(RC)` while
other languages are being enabled. Add an option that the
implementation can use to distinguish such calls from user-provided
calls.
diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx
index 9b7dd03..1c32f81 100644
--- a/Source/cmEnableLanguageCommand.cxx
+++ b/Source/cmEnableLanguageCommand.cxx
@@ -16,6 +16,7 @@ bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
bool optional = false;
+ bool internal = false;
std::vector<std::string> languages;
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
@@ -25,11 +26,13 @@ bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args,
it != args.end(); ++it) {
if ((*it) == "OPTIONAL") {
optional = true;
+ } else if ((*it) == "__CMAKE_INTERNAL") {
+ internal = true;
} else {
languages.push_back(*it);
}
}
- this->Makefile->EnableLanguage(languages, optional);
+ this->Makefile->EnableLanguage(languages, optional, internal);
return true;
}
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index 0f4de73..9f738ca 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -31,13 +31,15 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator(cmake* cm)
}
void cmGlobalBorlandMakefileGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
std::string outdir = this->CMakeInstance->GetHomeOutputDirectory();
mf->AddDefinition("BORLAND", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
- this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
+ this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional,
+ internal);
}
///! Create a local generator appropriate to this Global Generator
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 4e10f10..5a59e56 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -46,8 +46,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
virtual bool AllowNotParallel() const { return false; }
virtual bool AllowDeleteOnError() const { return false; }
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4c62be7..fc02800 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -371,7 +371,8 @@ bool cmGlobalGenerator::CheckLanguages(
//
void cmGlobalGenerator::EnableLanguage(
- std::vector<std::string> const& languages, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& languages, cmMakefile* mf, bool optional,
+ bool internal)
{
if (languages.empty()) {
cmSystemTools::Error("EnableLanguage must have a lang specified!");
@@ -379,6 +380,7 @@ void cmGlobalGenerator::EnableLanguage(
return;
}
+ static_cast<void>(internal);
std::set<std::string> cur_languages(languages.begin(), languages.end());
for (std::set<std::string>::iterator li = cur_languages.begin();
li != cur_languages.end(); ++li) {
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 8f1d70c..b32fd4e 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -120,7 +120,7 @@ public:
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ cmMakefile*, bool optional, bool internal);
/**
* Resolve the CMAKE_<lang>_COMPILER setting for the given language.
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index d75ebf8..cea7eeb 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -49,7 +49,8 @@ void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry& entry)
}
void cmGlobalGhsMultiGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
mf->AddDefinition("CMAKE_SYSTEM_NAME", "GHS-MULTI");
mf->AddDefinition("CMAKE_SYSTEM_PROCESSOR", "ARM");
@@ -79,7 +80,7 @@ void cmGlobalGhsMultiGenerator::EnableLanguage(
}
mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files
- this->cmGlobalGenerator::EnableLanguage(l, mf, optional);
+ this->cmGlobalGenerator::EnableLanguage(l, mf, optional, internal);
}
void cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile* mf)
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index b2aac45..7008e77 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -61,8 +61,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
/*
* Determine what program to use for building the project.
*/
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx
index 0bdd624..87eb217 100644
--- a/Source/cmGlobalJOMMakefileGenerator.cxx
+++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -30,12 +30,14 @@ cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator(cmake* cm)
}
void cmGlobalJOMMakefileGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
// pick a default
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
- this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
+ this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional,
+ internal);
}
void cmGlobalJOMMakefileGenerator::GetDocumentation(
diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h
index bb2273a..a66dcc6 100644
--- a/Source/cmGlobalJOMMakefileGenerator.h
+++ b/Source/cmGlobalJOMMakefileGenerator.h
@@ -43,8 +43,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
private:
void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx
index 6bf178a..c544aad 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.cxx
+++ b/Source/cmGlobalMSYSMakefileGenerator.cxx
@@ -47,7 +47,8 @@ std::string cmGlobalMSYSMakefileGenerator::FindMinGW(
}
void cmGlobalMSYSMakefileGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
this->FindMakeProgram(mf);
std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
@@ -76,7 +77,8 @@ void cmGlobalMSYSMakefileGenerator::EnableLanguage(
mf->AddDefinition("CMAKE_GENERATOR_CC", gcc.c_str());
mf->AddDefinition("CMAKE_GENERATOR_CXX", gxx.c_str());
mf->AddDefinition("CMAKE_GENERATOR_RC", rc.c_str());
- this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
+ this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional,
+ internal);
if (!mf->IsSet("CMAKE_AR") && !this->CMakeInstance->GetIsInTryCompile() &&
!(1 == l.size() && l[0] == "NONE")) {
diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h
index d687d19..4208e16 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.h
+++ b/Source/cmGlobalMSYSMakefileGenerator.h
@@ -42,8 +42,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
private:
std::string FindMinGW(std::string const& makeloc);
diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx
index 05f1b36..e61e54b 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.cxx
+++ b/Source/cmGlobalMinGWMakefileGenerator.cxx
@@ -26,7 +26,8 @@ cmGlobalMinGWMakefileGenerator::cmGlobalMinGWMakefileGenerator(cmake* cm)
}
void cmGlobalMinGWMakefileGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
this->FindMakeProgram(mf);
std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
@@ -52,7 +53,8 @@ void cmGlobalMinGWMakefileGenerator::EnableLanguage(
mf->AddDefinition("CMAKE_GENERATOR_CC", gcc.c_str());
mf->AddDefinition("CMAKE_GENERATOR_CXX", gxx.c_str());
mf->AddDefinition("CMAKE_GENERATOR_RC", rc.c_str());
- this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
+ this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional,
+ internal);
}
void cmGlobalMinGWMakefileGenerator::GetDocumentation(
diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h
index 90cfde7..2773dbd 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.h
+++ b/Source/cmGlobalMinGWMakefileGenerator.h
@@ -42,8 +42,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
};
#endif
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 605a773..6216186 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -30,12 +30,14 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator(cmake* cm)
}
void cmGlobalNMakeMakefileGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
// pick a default
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
- this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
+ this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional,
+ internal);
}
void cmGlobalNMakeMakefileGenerator::GetDocumentation(
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h
index 3ab684e..5b0965f 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.h
+++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -42,8 +42,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
private:
void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 81690e7..4ac7623 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -639,9 +639,10 @@ bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const
}
void cmGlobalNinjaGenerator::EnableLanguage(
- std::vector<std::string> const& langs, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& langs, cmMakefile* mf, bool optional,
+ bool internal)
{
- this->cmGlobalGenerator::EnableLanguage(langs, mf, optional);
+ this->cmGlobalGenerator::EnableLanguage(langs, mf, optional, internal);
for (std::vector<std::string>::const_iterator l = langs.begin();
l != langs.end(); ++l) {
if (*l == "NONE") {
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 76430a0..1b3071c 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -194,8 +194,8 @@ public:
static void GetDocumentation(cmDocumentationEntry& entry);
- void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile* mf, bool optional) CM_OVERRIDE;
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
void GenerateBuildCommand(std::vector<std::string>& makeCommand,
const std::string& makeProgram,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 52ae469..ba0fe00 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -53,9 +53,10 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm)
}
void cmGlobalUnixMakefileGenerator3::EnableLanguage(
- std::vector<std::string> const& languages, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& languages, cmMakefile* mf, bool optional,
+ bool internal)
{
- this->cmGlobalGenerator::EnableLanguage(languages, mf, optional);
+ this->cmGlobalGenerator::EnableLanguage(languages, mf, optional, internal);
for (std::vector<std::string>::const_iterator l = languages.begin();
l != languages.end(); ++l) {
if (*l == "NONE") {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 3724124..2c55e1c 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -105,7 +105,7 @@ public:
* extension, pthreads, byte order etc.
*/
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
- bool optional) CM_OVERRIDE;
+ bool optional, bool internal) CM_OVERRIDE;
void Configure() CM_OVERRIDE;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index ac9c8ef..35baad3 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -315,9 +315,10 @@ void cmGlobalVisualStudio10Generator::Generate()
}
void cmGlobalVisualStudio10Generator::EnableLanguage(
- std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& lang, cmMakefile* mf, bool optional,
+ bool internal)
{
- cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
+ cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional, internal);
}
const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 51fd5a5..de77ecb 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -46,8 +46,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
virtual void WriteSLNHeader(std::ostream& fout);
/** Generating for Nsight Tegra VS plugin? */
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 7664b02..911a296 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -100,7 +100,8 @@ const char* cmGlobalVisualStudio7Generator::GetIntelProjectVersion()
}
void cmGlobalVisualStudio7Generator::EnableLanguage(
- std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& lang, cmMakefile* mf, bool optional,
+ bool internal)
{
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
@@ -114,7 +115,7 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(
}
// Create list of configurations requested by user's cache, if any.
- this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
+ this->cmGlobalGenerator::EnableLanguage(lang, mf, optional, internal);
// if this environment variable is set, then copy it to
// a static cache entry. It will be used by
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 8a33ee0..f80d442 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -57,8 +57,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
/**
* Try running cmake and building a file. This is used for dynamically
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 53a05a0..99ed1b8 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -125,7 +125,8 @@ std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand()
}
void cmGlobalVisualStudio8Generator::EnableLanguage(
- std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& lang, cmMakefile* mf, bool optional,
+ bool internal)
{
for (std::vector<std::string>::const_iterator it = lang.begin();
it != lang.end(); ++it) {
@@ -134,7 +135,7 @@ void cmGlobalVisualStudio8Generator::EnableLanguage(
}
}
this->AddPlatformDefinitions(mf);
- cmGlobalVisualStudio7Generator::EnableLanguage(lang, mf, optional);
+ cmGlobalVisualStudio7Generator::EnableLanguage(lang, mf, optional, internal);
}
void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index b29106f..fa34747 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -32,8 +32,8 @@ public:
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
virtual void AddPlatformDefinitions(cmMakefile* mf);
virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index d8f1d93..46427f6 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -37,7 +37,8 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm)
}
void cmGlobalWatcomWMakeGenerator::EnableLanguage(
- std::vector<std::string> const& l, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& l, cmMakefile* mf, bool optional,
+ bool internal)
{
// pick a default
mf->AddDefinition("WATCOM", "1");
@@ -47,7 +48,8 @@ void cmGlobalWatcomWMakeGenerator::EnableLanguage(
mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
- this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
+ this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional,
+ internal);
}
void cmGlobalWatcomWMakeGenerator::GetDocumentation(
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index df1168e..87b62bc 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -52,7 +52,7 @@ public:
* extension, pthreads, byte order etc.
*/
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
- bool optional) CM_OVERRIDE;
+ bool optional, bool internal) CM_OVERRIDE;
bool AllowNotParallel() const CM_OVERRIDE { return false; }
bool AllowDeleteOnError() const CM_OVERRIDE { return false; }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 0d5de06..0866cc1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -241,7 +241,8 @@ bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
}
void cmGlobalXCodeGenerator::EnableLanguage(
- std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
+ std::vector<std::string> const& lang, cmMakefile* mf, bool optional,
+ bool internal)
{
mf->AddDefinition("XCODE", "1");
mf->AddDefinition("XCODE_VERSION", this->VersionString.c_str());
@@ -257,7 +258,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(
}
}
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
- this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
+ this->cmGlobalGenerator::EnableLanguage(lang, mf, optional, internal);
const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES");
const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT");
if (osxArch && sysroot) {
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index ebdba3e..6766212 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -48,8 +48,8 @@ public:
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional, bool internal) CM_OVERRIDE;
/**
* Try running cmake and building a file. This is used for dynalically
* loaded commands, not as part of the usual build process.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 50e7b33..b5a6e1d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3147,11 +3147,11 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
}
void cmMakefile::EnableLanguage(std::vector<std::string> const& lang,
- bool optional)
+ bool optional, bool internal)
{
this->AddDefinition("CMAKE_CFG_INTDIR",
this->GetGlobalGenerator()->GetCMakeCFGIntDir());
- this->GetGlobalGenerator()->EnableLanguage(lang, this, optional);
+ this->GetGlobalGenerator()->EnableLanguage(lang, this, optional, internal);
}
int cmMakefile::TryCompile(const std::string& srcdir,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index eb382df..c7e9927 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -574,8 +574,8 @@ public:
///! Enable support for named language, if nil then all languages are
/// enabled.
- void EnableLanguage(std::vector<std::string> const& languages,
- bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, bool optional,
+ bool internal);
cmState* GetState() const;
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 6f98d94..2b0aac9 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -199,7 +199,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
languages.push_back("C");
languages.push_back("CXX");
}
- this->Makefile->EnableLanguage(languages, false);
+ this->Makefile->EnableLanguage(languages, false, false);
std::string extraInclude = "CMAKE_PROJECT_" + args[0] + "_INCLUDE";
const char* include = this->Makefile->GetDefinition(extraInclude);
if (include) {
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2136775e1ffbd2ccf9b355181d58fa594eb2b2d3
commit 2136775e1ffbd2ccf9b355181d58fa594eb2b2d3
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: Tue Sep 27 08:38:18 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:
Modules/Platform/CYGWIN-GNU.cmake | 2 +-
Modules/Platform/Windows-GNU.cmake | 2 +-
Modules/Platform/Windows-MSVC.cmake | 2 +-
Source/cmEnableLanguageCommand.cxx | 5 ++++-
Source/cmGlobalBorlandMakefileGenerator.cxx | 6 ++++--
Source/cmGlobalBorlandMakefileGenerator.h | 4 ++--
Source/cmGlobalGenerator.cxx | 13 ++++++++-----
Source/cmGlobalGenerator.h | 2 +-
Source/cmGlobalGhsMultiGenerator.cxx | 5 +++--
Source/cmGlobalGhsMultiGenerator.h | 4 ++--
Source/cmGlobalJOMMakefileGenerator.cxx | 6 ++++--
Source/cmGlobalJOMMakefileGenerator.h | 4 ++--
Source/cmGlobalMSYSMakefileGenerator.cxx | 6 ++++--
Source/cmGlobalMSYSMakefileGenerator.h | 4 ++--
Source/cmGlobalMinGWMakefileGenerator.cxx | 6 ++++--
Source/cmGlobalMinGWMakefileGenerator.h | 4 ++--
Source/cmGlobalNMakeMakefileGenerator.cxx | 6 ++++--
Source/cmGlobalNMakeMakefileGenerator.h | 4 ++--
Source/cmGlobalNinjaGenerator.cxx | 5 +++--
Source/cmGlobalNinjaGenerator.h | 4 ++--
Source/cmGlobalUnixMakefileGenerator3.cxx | 5 +++--
Source/cmGlobalUnixMakefileGenerator3.h | 2 +-
Source/cmGlobalVisualStudio10Generator.cxx | 5 +++--
Source/cmGlobalVisualStudio10Generator.h | 4 ++--
Source/cmGlobalVisualStudio7Generator.cxx | 5 +++--
Source/cmGlobalVisualStudio7Generator.h | 4 ++--
Source/cmGlobalVisualStudio8Generator.cxx | 5 +++--
Source/cmGlobalVisualStudio8Generator.h | 4 ++--
Source/cmGlobalWatcomWMakeGenerator.cxx | 6 ++++--
Source/cmGlobalWatcomWMakeGenerator.h | 2 +-
Source/cmGlobalXCodeGenerator.cxx | 5 +++--
Source/cmGlobalXCodeGenerator.h | 4 ++--
Source/cmMakefile.cxx | 4 ++--
Source/cmMakefile.h | 4 ++--
Source/cmProjectCommand.cxx | 2 +-
Tests/CMakeLists.txt | 23 ++++++++++++-----------
Tests/RunCMake/CMakeLists.txt | 2 +-
Tests/RunCMake/project/ExplicitRC.cmake | 1 +
Tests/RunCMake/project/RunCMakeTest.cmake | 3 +++
39 files changed, 107 insertions(+), 77 deletions(-)
create mode 100644 Tests/RunCMake/project/ExplicitRC.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list