mirror of
https://github.com/reactos/CMake.git
synced 2024-11-25 20:49:41 +00:00
Merge topic 'DontCrashAutomocWithEmptyCompileDefs'
1ecc55a
Automoc: fix the fix, need to use std::string, not just char* pointer8c8305f
don't crash in automoc with empty COMPILE_DEFINITIONS property
This commit is contained in:
commit
6c2f30822b
@ -124,9 +124,13 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
|
||||
}
|
||||
}
|
||||
|
||||
std::string _moc_incs = makefile->GetProperty("INCLUDE_DIRECTORIES");
|
||||
std::string _moc_defs = makefile->GetProperty("DEFINITIONS");
|
||||
std::string _moc_compile_defs = makefile->GetProperty("COMPILE_DEFINITIONS");
|
||||
const char* tmp = makefile->GetProperty("INCLUDE_DIRECTORIES");
|
||||
std::string _moc_incs = (tmp!=0 ? tmp : "");
|
||||
tmp = makefile->GetProperty("DEFINITIONS");
|
||||
std::string _moc_defs = (tmp!=0 ? tmp : "");
|
||||
tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
|
||||
std::string _moc_compile_defs = (tmp!=0 ? tmp : "");
|
||||
|
||||
// forget the variables added here afterwards again:
|
||||
cmMakefile::ScopePushPop varScope(makefile);
|
||||
static_cast<void>(varScope);
|
||||
@ -138,7 +142,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
|
||||
makefile->AddDefinition("_moc_files", _moc_files.c_str());
|
||||
makefile->AddDefinition("_moc_headers", _moc_headers.c_str());
|
||||
|
||||
const char* cmakeRoot = makefile->GetDefinition("CMAKE_ROOT");
|
||||
const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
|
||||
std::string inputFile = cmakeRoot;
|
||||
inputFile += "/Modules/AutomocInfo.cmake.in";
|
||||
std::string outputFile = targetDir;
|
||||
|
Loading…
Reference in New Issue
Block a user