Merge topic 'fix-CMP0049-extra-error'
b2282631 cmTarget: Do not mistake a preceding error for a CMP0049 failure
This commit is contained in:
commit
bd642272b9
@ -926,12 +926,15 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
|
|||||||
const char* src = filename.c_str();
|
const char* src = filename.c_str();
|
||||||
|
|
||||||
if(!(src[0] == '$' && src[1] == '<'))
|
if(!(src[0] == '$' && src[1] == '<'))
|
||||||
|
{
|
||||||
|
if(!filename.empty())
|
||||||
{
|
{
|
||||||
filename = this->ProcessSourceItemCMP0049(filename);
|
filename = this->ProcessSourceItemCMP0049(filename);
|
||||||
if (cmSystemTools::GetErrorOccuredFlag())
|
if(filename.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this->Makefile->GetOrCreateSource(filename);
|
this->Makefile->GetOrCreateSource(filename);
|
||||||
}
|
}
|
||||||
srcFiles += sep;
|
srcFiles += sep;
|
||||||
@ -998,8 +1001,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s)
|
|||||||
cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s)
|
cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s)
|
||||||
{
|
{
|
||||||
std::string src = this->ProcessSourceItemCMP0049(s);
|
std::string src = this->ProcessSourceItemCMP0049(s);
|
||||||
|
if(!s.empty() && src.empty())
|
||||||
if (cmSystemTools::GetErrorOccuredFlag())
|
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -0,0 +1,9 @@
|
|||||||
|
^CMake Error at CustomTargetAfterError.cmake:1 \(message\):
|
||||||
|
Error before add_custom_target
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
+
|
||||||
|
CMake Error at CustomTargetAfterError.cmake:3 \(message\):
|
||||||
|
Error after add_custom_target
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)$
|
3
Tests/RunCMake/Configure/CustomTargetAfterError.cmake
Normal file
3
Tests/RunCMake/Configure/CustomTargetAfterError.cmake
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
message(SEND_ERROR "Error before add_custom_target")
|
||||||
|
add_custom_target(foo COMMAND echo)
|
||||||
|
message(SEND_ERROR "Error after add_custom_target")
|
@ -1,5 +1,6 @@
|
|||||||
include(RunCMake)
|
include(RunCMake)
|
||||||
|
|
||||||
|
run_cmake(CustomTargetAfterError)
|
||||||
run_cmake(ErrorLogs)
|
run_cmake(ErrorLogs)
|
||||||
run_cmake(FailCopyFileABI)
|
run_cmake(FailCopyFileABI)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user