Merge topic 'target-command-allow-no-items'
c0b8682
Allow target commands to be invoked with no items (#14325).
This commit is contained in:
commit
a26e7d0782
|
@ -19,7 +19,7 @@ bool cmTargetPropCommandBase
|
||||||
::HandleArguments(std::vector<std::string> const& args, const char *prop,
|
::HandleArguments(std::vector<std::string> const& args, const char *prop,
|
||||||
ArgumentFlags flags)
|
ArgumentFlags flags)
|
||||||
{
|
{
|
||||||
if(args.size() < 3)
|
if(args.size() < 2)
|
||||||
{
|
{
|
||||||
this->SetError("called with incorrect number of arguments");
|
this->SetError("called with incorrect number of arguments");
|
||||||
return false;
|
return false;
|
||||||
|
@ -53,7 +53,7 @@ bool cmTargetPropCommandBase
|
||||||
|
|
||||||
if ((flags & PROCESS_SYSTEM) && args[argIndex] == "SYSTEM")
|
if ((flags & PROCESS_SYSTEM) && args[argIndex] == "SYSTEM")
|
||||||
{
|
{
|
||||||
if (args.size() < 4)
|
if (args.size() < 3)
|
||||||
{
|
{
|
||||||
this->SetError("called with incorrect number of arguments");
|
this->SetError("called with incorrect number of arguments");
|
||||||
return false;
|
return false;
|
||||||
|
@ -65,7 +65,7 @@ bool cmTargetPropCommandBase
|
||||||
bool prepend = false;
|
bool prepend = false;
|
||||||
if ((flags & PROCESS_BEFORE) && args[argIndex] == "BEFORE")
|
if ((flags & PROCESS_BEFORE) && args[argIndex] == "BEFORE")
|
||||||
{
|
{
|
||||||
if (args.size() < 4)
|
if (args.size() < 3)
|
||||||
{
|
{
|
||||||
this->SetError("called with incorrect number of arguments");
|
this->SetError("called with incorrect number of arguments");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -20,3 +20,8 @@ target_compile_definitions(consumer
|
||||||
PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
|
PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
|
||||||
-DDASH_D_DEFINE
|
-DDASH_D_DEFINE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Test no items
|
||||||
|
target_compile_definitions(consumer
|
||||||
|
PRIVATE
|
||||||
|
)
|
||||||
|
|
|
@ -33,3 +33,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
"DO_GNU_TESTS"
|
"DO_GNU_TESTS"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Test no items
|
||||||
|
target_compile_options(consumer
|
||||||
|
PRIVATE
|
||||||
|
)
|
||||||
|
|
|
@ -47,3 +47,17 @@ target_include_directories(consumer
|
||||||
$<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
relative_dir
|
relative_dir
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Test no items
|
||||||
|
target_include_directories(consumer
|
||||||
|
PRIVATE
|
||||||
|
)
|
||||||
|
target_include_directories(consumer
|
||||||
|
BEFORE PRIVATE
|
||||||
|
)
|
||||||
|
target_include_directories(consumer
|
||||||
|
SYSTEM BEFORE PRIVATE
|
||||||
|
)
|
||||||
|
target_include_directories(consumer
|
||||||
|
SYSTEM PRIVATE
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue