Merge topic 'no-assert-missing-objlib'
d648c476 cmTarget: Don't assert on object libraries for configure-time location.
This commit is contained in:
commit
295cf31ca6
Source
Tests/RunCMake/CMP0026
@ -5564,8 +5564,10 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
|
||||
continue;
|
||||
}
|
||||
cmTarget *objLib = this->Makefile->FindTargetToUse(objLibName.c_str());
|
||||
assert(objLib);
|
||||
objlibs.push_back(objLib);
|
||||
if(objLib)
|
||||
{
|
||||
objlibs.push_back(objLib);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1
Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt
Normal file
1
Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt
Normal file
@ -0,0 +1 @@
|
||||
0
|
12
Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
Normal file
12
Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
CMake Warning \(dev\) at ObjlibNotDefined.cmake:[0-9]+ \(get_target_property\):
|
||||
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
|
||||
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
|
||||
command to set the policy and suppress this warning.
|
||||
|
||||
The LOCATION property should not be read from target "objlibuser". Use the
|
||||
target name directly with add_custom_command, or use the generator
|
||||
expression \$<TARGET_FILE>, as appropriate.
|
||||
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
13
Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake
Normal file
13
Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
enable_language(CXX)
|
||||
|
||||
add_executable(objlibuser
|
||||
empty.cpp
|
||||
$<TARGET_OBJECTS:bar>
|
||||
)
|
||||
|
||||
get_target_property(_location objlibuser LOCATION)
|
||||
|
||||
add_library(bar OBJECT
|
||||
empty.cpp
|
||||
)
|
@ -9,3 +9,4 @@ run_cmake(CMP0026-CONFIG-LOCATION-WARN)
|
||||
run_cmake(CMP0026-LOCATION-CONFIG-NEW)
|
||||
run_cmake(CMP0026-LOCATION-CONFIG-OLD)
|
||||
run_cmake(CMP0026-LOCATION-CONFIG-WARN)
|
||||
run_cmake(ObjlibNotDefined)
|
||||
|
Loading…
x
Reference in New Issue
Block a user