mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)
The API for retrieving per-config COMPILE_DEFINITIONS has long existed because of the COMPILE_DEFINITIONS_<CONFIG> style properties. Ensure that the provided configuration being generated is also used to evaluate the generator expressions in cmTarget::GetCompileDefinitions. Both the generic COMPILE_DEFINITIONS and the config-specific variant need to be evaluated with the requested configuration. This has the side-effect that the COMPILE_DEFINITIONS does not need to be additionally evaluated with no configuration, so the callers can be cleaned up a bit too.
This commit is contained in:
@@ -621,7 +621,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
||||
->GetGeneratorTarget(target);
|
||||
|
||||
// the compilerdefines for this target
|
||||
std::string cdefs = target->GetCompileDefinitions();
|
||||
std::string cdefs = target->GetCompileDefinitions(buildType);
|
||||
|
||||
if(!cdefs.empty())
|
||||
{
|
||||
@@ -640,10 +640,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
||||
std::set<std::string> uniqIncludeDirs;
|
||||
|
||||
std::vector<std::string> includes;
|
||||
const char *config = target->GetMakefile()
|
||||
->GetDefinition("CMAKE_BUILD_TYPE");
|
||||
target->GetMakefile()->GetLocalGenerator()->
|
||||
GetIncludeDirectories(includes, gtgt, "C", config);
|
||||
GetIncludeDirectories(includes, gtgt, "C", buildType);
|
||||
for(std::vector<std::string>::const_iterator dirIt=includes.begin();
|
||||
dirIt != includes.end();
|
||||
++dirIt)
|
||||
|
||||
Reference in New Issue
Block a user