summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetSourcesCommand.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-06-16 18:51:30 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-07-06 14:15:23 (GMT)
commitf3cfde394a903928cc379f3a56a9cb9618def665 (patch)
treecfe08d26ac37a4b3d378f0269883f1906a32a591 /Source/cmTargetSourcesCommand.cxx
parentea3175a4ebba7bf8688f2f62f434a1602012ab61 (diff)
downloadCMake-f3cfde394a903928cc379f3a56a9cb9618def665.zip
CMake-f3cfde394a903928cc379f3a56a9cb9618def665.tar.gz
CMake-f3cfde394a903928cc379f3a56a9cb9618def665.tar.bz2
cmTargetSourcesCommand: allow `INTERFACE` C++ modules when imported
`PUBLIC` filesets become `INTERFACE` upon installation. Allow `INTERFACE` scopes for C++ modules when the target is imported.
Diffstat (limited to 'Source/cmTargetSourcesCommand.cxx')
-rw-r--r--Source/cmTargetSourcesCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx
index 76b0384..74945fa 100644
--- a/Source/cmTargetSourcesCommand.cxx
+++ b/Source/cmTargetSourcesCommand.cxx
@@ -269,7 +269,8 @@ bool TargetSourcesImpl::HandleOneFileSet(
}
if (cmFileSetVisibilityIsForInterface(visibility) &&
- !cmFileSetVisibilityIsForSelf(visibility)) {
+ !cmFileSetVisibilityIsForSelf(visibility) &&
+ !this->Target->IsImported()) {
if (type == "CXX_MODULES"_s || type == "CXX_MODULE_HEADER_UNITS"_s) {
this->SetError(
R"(File set TYPEs "CXX_MODULES" and "CXX_MODULE_HEADER_UNITS" may not have "INTERFACE" visibility)");