mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
Merge topic 'read-only-type-target-property'
98f21433 cmTarget: Enforce TYPE being a read-only property
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
TYPE property is read-only
|
||||
@@ -0,0 +1,2 @@
|
||||
add_custom_target(CustomTarget)
|
||||
set_property(TARGET CustomTarget PROPERTY TYPE foo)
|
||||
Reference in New Issue
Block a user