mirror of
https://github.com/reactos/CMake.git
synced 2024-12-11 21:34:32 +00:00
cmTarget: Enforce TYPE being a read-only property
This commit is contained in:
parent
2da3ae3bf7
commit
98f2143305
@ -858,6 +858,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||
return;
|
||||
}
|
||||
if (prop == "TYPE") {
|
||||
std::ostringstream e;
|
||||
e << "TYPE property is read-only\n";
|
||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||
return;
|
||||
}
|
||||
if (prop == "EXPORT_NAME" && this->IsImported()) {
|
||||
std::ostringstream e;
|
||||
e << "EXPORT_NAME property can't be set on imported targets (\""
|
||||
|
@ -6,4 +6,5 @@ run_cmake(COMPILE_OPTIONS)
|
||||
run_cmake(INCLUDE_DIRECTORIES)
|
||||
run_cmake(LINK_LIBRARIES)
|
||||
run_cmake(SOURCES)
|
||||
run_cmake(TYPE)
|
||||
run_cmake(USER_PROP)
|
||||
|
1
Tests/RunCMake/set_property/TYPE-result.txt
Normal file
1
Tests/RunCMake/set_property/TYPE-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
1
Tests/RunCMake/set_property/TYPE-stderr.txt
Normal file
1
Tests/RunCMake/set_property/TYPE-stderr.txt
Normal file
@ -0,0 +1 @@
|
||||
TYPE property is read-only
|
2
Tests/RunCMake/set_property/TYPE.cmake
Normal file
2
Tests/RunCMake/set_property/TYPE.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
add_custom_target(CustomTarget)
|
||||
set_property(TARGET CustomTarget PROPERTY TYPE foo)
|
Loading…
Reference in New Issue
Block a user