C++ modules: using a file extension `cppp` in FILE_SET causes an exception
I am experimenting with the C++ modules support and I have the following snippet:
target_sources("${PROJECT_NAME}"
PUBLIC
FILE_SET cxx_modules TYPE CXX_MODULES FILES
"src/functions.cppp"
"src/library.cppm"
)
If I have functions.cppm
, function.cpp
the above snippet generates the project correctly. If I rename it to functions.cppp
I get:
[main] Configuring project: RToolBox
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -SX:/GitHub/RToolBox/RToolBox -BX:/GitHub/RToolBox/build/default.ninja-multi.msvc -G "Ninja Multi-Config"
[cmake] CMake Warning (dev) at CMakeLists.txt:29 (target_sources):
[cmake] CMake's C++ module support is experimental. It is meant only for
[cmake] experimentation and feedback to CMake developers.
[cmake] This warning is for project developers. Use -Wno-dev to suppress it.
[cmake]
[cmake] -- Configuring done (0.0s)
[cmake] CMake Internal Error (please report a bug) in CMakeLists.txt:
[cmake] Target "RToolBox" has source file
[cmake] "X:/GitHub/RToolBox/RToolBox/src/functions.cppp" which is not in any of its
[cmake] "FILE_SET BASE_DIRS".
[cmake]
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_passphrase_callback
[cmake] at BaseThreadInitThunk
[cmake] at RtlUserThreadStart
[cmake]
[cmake]
[cmake] CMake Internal Error (please report a bug) in CMakeLists.txt:
[cmake] Target "RToolBox" has source file
[cmake] "X:/GitHub/RToolBox/RToolBox/src/functions.cppp" which is not in any of its
[cmake] "FILE_SET BASE_DIRS".
[cmake]
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_passphrase_callback
[cmake] at BaseThreadInitThunk
[cmake] at RtlUserThreadStart
[cmake]
[cmake]
[cmake] CMake Internal Error (please report a bug) in CMakeLists.txt:
[cmake] Target "RToolBox" has source file
[cmake] "X:/GitHub/RToolBox/RToolBox/src/functions.cppp" which is not in any of its
[cmake] "FILE_SET BASE_DIRS".
[cmake]
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_entry_uid
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_compression_none
[cmake] at archive_write_set_passphrase_callback
[cmake] at BaseThreadInitThunk
[cmake] at RtlUserThreadStart
[cmake]
[cmake]
[cmake] -- Generating done (0.1s)
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -SX:/GitHub/RToolBox/RToolBox -BX:/GitHub/RToolBox/build/default.ninja-multi.msvc -G "Ninja Multi-Config" exited with code: 1
Edited by Zingam