mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-17 04:31:04 -06:00
Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio
Issue: #17435
This commit is contained in:
@@ -828,12 +828,16 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
|
|||||||
}
|
}
|
||||||
std::string genName = gg->GetName();
|
std::string genName = gg->GetName();
|
||||||
if (genName.find("Visual Studio") != std::string::npos) {
|
if (genName.find("Visual Studio") != std::string::npos) {
|
||||||
reportError(context, content->GetOriginalExpression(),
|
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
|
||||||
"$<COMPILE_LANGUAGE:...> may not be used with Visual Studio "
|
dagChecker->EvaluatingCompileOptions() ||
|
||||||
"generators.");
|
dagChecker->EvaluatingIncludeDirectories())) {
|
||||||
return std::string();
|
reportError(
|
||||||
}
|
context, content->GetOriginalExpression(),
|
||||||
if (genName.find("Xcode") != std::string::npos) {
|
"$<COMPILE_LANGUAGE:...> may only be used for file(GENERATE) "
|
||||||
|
"with the Visual Studio generator.");
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
} else if (genName.find("Xcode") != std::string::npos) {
|
||||||
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
|
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
|
||||||
dagChecker->EvaluatingIncludeDirectories())) {
|
dagChecker->EvaluatingIncludeDirectories())) {
|
||||||
reportError(
|
reportError(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ CMake Error at CompileDefinitions.cmake:5 \(target_compile_definitions\):
|
|||||||
|
|
||||||
\$<COMPILE_LANGUAGE:CXX>
|
\$<COMPILE_LANGUAGE:CXX>
|
||||||
|
|
||||||
\$<COMPILE_LANGUAGE:...> may not be used with Visual Studio generators.
|
\$<COMPILE_LANGUAGE:...> may only be used for file\(GENERATE\) with the Visual
|
||||||
|
Studio generator.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
CMakeLists.txt:3 \(include\)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ CMake Error at CompileOptions.cmake:5 \(target_compile_options\):
|
|||||||
|
|
||||||
\$<COMPILE_LANGUAGE:CXX>
|
\$<COMPILE_LANGUAGE:CXX>
|
||||||
|
|
||||||
\$<COMPILE_LANGUAGE:...> may not be used with Visual Studio generators.
|
\$<COMPILE_LANGUAGE:...> may only be used for file\(GENERATE\) with the Visual
|
||||||
|
Studio generator.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
CMakeLists.txt:3 \(include\)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ CMake Error at IncludeDirectories.cmake:5 \(target_include_directories\):
|
|||||||
|
|
||||||
\$<COMPILE_LANGUAGE:CXX>
|
\$<COMPILE_LANGUAGE:CXX>
|
||||||
|
|
||||||
\$<COMPILE_LANGUAGE:...> may not be used with Visual Studio generators.
|
\$<COMPILE_LANGUAGE:...> may only be used for file\(GENERATE\) with the Visual
|
||||||
|
Studio generator.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
CMakeLists.txt:3 \(include\)
|
||||||
|
|||||||
@@ -21,15 +21,13 @@ if (NOT file_contents MATCHES "generated.cpp.rule")
|
|||||||
message(SEND_ERROR "Rule file not in target sources! ${file_contents}")
|
message(SEND_ERROR "Rule file not in target sources! ${file_contents}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT RunCMake_GENERATOR MATCHES "Visual Studio")
|
run_cmake(COMPILE_LANGUAGE-genex)
|
||||||
run_cmake(COMPILE_LANGUAGE-genex)
|
foreach(l CXX C)
|
||||||
foreach(l CXX C)
|
file(READ "${RunCMake_BINARY_DIR}/COMPILE_LANGUAGE-genex-build/opts-${l}.txt" l_defs)
|
||||||
file(READ "${RunCMake_BINARY_DIR}/COMPILE_LANGUAGE-genex-build/opts-${l}.txt" l_defs)
|
if (NOT l_defs STREQUAL "LANG_IS_${l}\n")
|
||||||
if (NOT l_defs STREQUAL "LANG_IS_${l}\n")
|
message(FATAL_ERROR "File content does not match: ${l_defs}")
|
||||||
message(FATAL_ERROR "File content does not match: ${l_defs}")
|
endif()
|
||||||
endif()
|
endforeach()
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(timeformat "%Y%j%H%M%S")
|
set(timeformat "%Y%j%H%M%S")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user