cmTarget: Don't create duplicate backtraces in CMP0046 warning
This commit is contained in:
parent
7534967b65
commit
d83245a34f
@ -403,11 +403,10 @@ void cmTarget::SetMakefile(cmMakefile* mf)
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::AddUtility(const char *u, cmMakefile *makefile)
|
void cmTarget::AddUtility(const char *u, cmMakefile *makefile)
|
||||||
{
|
{
|
||||||
this->Utilities.insert(u);
|
if(this->Utilities.insert(u).second && makefile)
|
||||||
if(makefile)
|
{
|
||||||
{
|
|
||||||
makefile->GetBacktrace(UtilityBacktraces[u]);
|
makefile->GetBacktrace(UtilityBacktraces[u]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
1
Tests/RunCMake/CMP0046/CMP0046-Duplicate-result.txt
Normal file
1
Tests/RunCMake/CMP0046/CMP0046-Duplicate-result.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
0
|
10
Tests/RunCMake/CMP0046/CMP0046-Duplicate-stderr.txt
Normal file
10
Tests/RunCMake/CMP0046/CMP0046-Duplicate-stderr.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CMake Warning \(dev\) at CMP0046-Duplicate.cmake:5 \(add_dependencies\):
|
||||||
|
Policy CMP0046 is not set: Error on non-existent dependency in
|
||||||
|
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
|
||||||
|
Use the cmake_policy command to set the policy and suppress this warning.
|
||||||
|
|
||||||
|
The dependency target "ctgt_no_exist" of target "dummy" does not exist.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMP0046-Duplicate.cmake:8 \(add_dep\)
|
||||||
|
CMakeLists.txt:3 \(include\)
|
||||||
|
This warning is for project developers. Use -Wno-dev to suppress it.
|
9
Tests/RunCMake/CMP0046/CMP0046-Duplicate.cmake
Normal file
9
Tests/RunCMake/CMP0046/CMP0046-Duplicate.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
add_library(dummy empty.cpp)
|
||||||
|
|
||||||
|
macro(add_dep)
|
||||||
|
add_dependencies(dummy ctgt_no_exist)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
add_dep()
|
||||||
|
add_dep()
|
@ -6,3 +6,4 @@ run_cmake(CMP0046-WARN-missing-dependency)
|
|||||||
|
|
||||||
run_cmake(CMP0046-OLD-existing-dependency)
|
run_cmake(CMP0046-OLD-existing-dependency)
|
||||||
run_cmake(CMP0046-NEW-existing-dependency)
|
run_cmake(CMP0046-NEW-existing-dependency)
|
||||||
|
run_cmake(CMP0046-Duplicate)
|
||||||
|
7
Tests/RunCMake/CMP0046/empty.cpp
Normal file
7
Tests/RunCMake/CMP0046/empty.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#ifdef _WIN32
|
||||||
|
__declspec(dllexport)
|
||||||
|
#endif
|
||||||
|
int empty()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user