mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
We support non-compiled `SOURCES` on `INTERFACE` libraries, and also support `CXX_MODULES` on *imported* `INTERFACE` libraries (via synthetic targets that compile module interface units). However, we do not support `CXX_MODULES` on non-imported `INTERFACE` libraries because there is no place to hold module interface unit's object files for their module initializers. Previously this was not explicitly rejected, and so was diagnosed only by "CMake Internal Error" messages due to assumption violations in the implementation. Fixes: #26524 Co-authored-by: Ben Boeckel <ben.boeckel@kitware.com>
9 lines
188 B
CMake
9 lines
188 B
CMake
add_library(module INTERFACE)
|
|
target_sources(module
|
|
INTERFACE
|
|
FILE_SET fs TYPE CXX_MODULES FILES
|
|
sources/module.cxx)
|
|
target_compile_features(module
|
|
INTERFACE
|
|
cxx_std_20)
|