|
1 | 1 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
2 | 2 |
|
3 | | -cmake_minimum_required(VERSION 3.28...4.2) |
| 3 | +cmake_minimum_required(VERSION 3.28...4.3) |
4 | 4 |
|
5 | 5 | # TODO: Set BEMAN_USE_MODULES if one of a particular set of compiler versions is being used |
6 | 6 |
|
7 | | -if (BEMAN_USE_MODULES) |
8 | | - set(CMAKE_CXX_SCAN_FOR_MODULES ON) |
9 | | - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444") |
| 7 | +if(BEMAN_USE_MODULES) |
| 8 | + set(CMAKE_CXX_SCAN_FOR_MODULES ON) |
| 9 | + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD |
| 10 | + "d0edc3af-4c50-42ea-a356-e2862fe7a444" |
| 11 | + ) |
10 | 12 | endif() |
11 | 13 |
|
12 | 14 | project( |
@@ -37,27 +39,38 @@ include(infra/cmake/beman-install-library.cmake) |
37 | 39 | add_library(beman.transform_view INTERFACE) |
38 | 40 | add_library(beman::transform_view ALIAS beman.transform_view) |
39 | 41 |
|
40 | | -target_sources( |
41 | | - beman.transform_view |
42 | | - PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" |
43 | | -) |
| 42 | +target_sources(beman.transform_view PUBLIC FILE_SET HEADERS BASE_DIRS include) |
44 | 43 |
|
45 | 44 | set_target_properties( |
46 | 45 | beman.transform_view |
47 | 46 | PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON |
48 | 47 | ) |
49 | 48 |
|
50 | 49 | add_subdirectory(include/beman/transform_view) |
51 | | -if (BEMAN_USE_MODULES) |
| 50 | + |
| 51 | +if(BEMAN_USE_MODULES) |
| 52 | + add_library(beman.transform_view_module STATIC) |
| 53 | + add_library(beman::transform_view_module ALIAS beman.transform_view_module) |
| 54 | + |
| 55 | + if(BEMAN_USE_STD_MODULES) |
| 56 | + target_compile_features(beman.transform_view_module PUBLIC cxx_std_23) |
| 57 | + # XXX set_target_properties(beman.transform_view_module PROPERTIES CXX_MODULE_STD ON) |
| 58 | + endif() |
| 59 | + |
| 60 | + target_sources( |
| 61 | + beman.transform_view_module |
| 62 | + PUBLIC FILE_SET HEADERS BASE_DIRS include |
| 63 | + ) |
| 64 | + |
52 | 65 | add_subdirectory(src/beman/transform_view) |
53 | 66 | endif() |
54 | 67 |
|
55 | | -include(CTest) |
| 68 | +# NOT needed! include(CTest) |
| 69 | +enable_testing() |
56 | 70 |
|
57 | | -beman_install_library(beman.transform_view TARGETS beman.transform_view) |
| 71 | +beman_install_library(beman.transform_view TARGETS beman.transform_view beman.transform_view_module) |
58 | 72 |
|
59 | 73 | if(BEMAN_TRANSFORM_VIEW_BUILD_TESTS) |
60 | | - enable_testing() |
61 | 74 | add_subdirectory(tests/beman/transform_view) |
62 | 75 | endif() |
63 | 76 |
|
|
0 commit comments