mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
@@ -321,6 +321,7 @@ endif ()
|
||||
|
||||
# Tests which require collation work.
|
||||
if ("collation" IN_LIST CMake_TEST_MODULE_COMPILATION)
|
||||
run_cxx_module_test(duplicate-sources)
|
||||
run_cxx_module_test(public-req-private)
|
||||
set(RunCMake_CXXModules_NO_TEST 1)
|
||||
run_cxx_module_test(req-private-other-target)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
cmake_minimum_required(VERSION 3.31)
|
||||
project(cxx_modules_duplicate_sources CXX)
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
|
||||
|
||||
add_executable(duplicate_sources)
|
||||
target_sources(duplicate_sources
|
||||
PRIVATE
|
||||
main.cxx
|
||||
PRIVATE
|
||||
FILE_SET CXX_MODULES
|
||||
BASE_DIRS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
FILES
|
||||
duplicate.cxx
|
||||
duplicate.cxx)
|
||||
target_compile_features(duplicate_sources PRIVATE cxx_std_20)
|
||||
|
||||
add_test(NAME duplicate_sources COMMAND duplicate_sources)
|
||||
@@ -0,0 +1,8 @@
|
||||
module;
|
||||
|
||||
export module duplicate;
|
||||
|
||||
export int from_import()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import duplicate;
|
||||
|
||||
int main()
|
||||
{
|
||||
return from_import();
|
||||
}
|
||||
Reference in New Issue
Block a user