summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmCommonTargetGenerator.cxx5
-rw-r--r--Tests/RunCMake/MultiLint/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/MultiLint/genex.cmake6
3 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 1924235..c781137 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -335,10 +335,7 @@ std::string cmCommonTargetGenerator::GenerateCodeCheckRules(
auto evaluatedProp = cmGeneratorExpression::Evaluate(
*value, this->GeneratorTarget->GetLocalGenerator(), config,
this->GeneratorTarget, nullptr, this->GeneratorTarget, lang);
- if (!evaluatedProp.empty()) {
- return evaluatedProp;
- }
- return *value;
+ return evaluatedProp;
};
std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY");
tidy = evaluateProp(tidy_prop);
diff --git a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake
index 9b7a6a9..f2df290 100644
--- a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake
+++ b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake
@@ -24,6 +24,7 @@ run_multilint(CXX)
if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
run_multilint(C-launch)
run_multilint(CXX-launch)
+ run_multilint(genex)
endif()
function(run_skip_linting test_name)
diff --git a/Tests/RunCMake/MultiLint/genex.cmake b/Tests/RunCMake/MultiLint/genex.cmake
new file mode 100644
index 0000000..17f9248
--- /dev/null
+++ b/Tests/RunCMake/MultiLint/genex.cmake
@@ -0,0 +1,6 @@
+enable_language(CXX)
+set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$<IF:$<BOOL:FALSE>,${PSEUDO_IWYU},>")
+set(CMAKE_CXX_CLANG_TIDY "$<IF:$<BOOL:FALSE>,${PSEUDO_TIDY} --error,>")
+set(CMAKE_CXX_CPPLINT "$<IF:$<BOOL:FALSE>,${PSEUDO_CPPLINT} --error,>")
+set(CMAKE_CXX_CPPCHECK "$<IF:$<BOOL:FALSE>,${PSEUDO_CPPCHECK} -bad,>")
+add_executable(main main.cxx)