A GitLab update will be applied today, 9/24. The site may be slow between 12pm - 12:45pm Fri 9/24 EDT (UTC -400).

Commit 7cea3479 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'fix-explicit-RC'

9c5238df project: Fix support for explicit RC language
40c04821 Tests: Decide earlier whether to test resources
parents 4f719f23 9c5238df
......@@ -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,
......
......@@ -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)
......
......@@ -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)
......
include(RunCMake)
if(CMake_TEST_RESOURCES)
run_cmake(ExplicitRC)
endif()
run_cmake(LanguagesImplicit)
run_cmake(LanguagesEmpty)
run_cmake(LanguagesNONE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment