Skip to content

Commit defc5b4

Browse files
authored
Feature/add modules example (#360)
* Add missing exports to GNUmakefile * Add missing modules examples Bump cmake policy range to ...4.5 for examples too
1 parent 4547d21 commit defc5b4

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎GNUmakefile‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ compile_commands.json: $(_build_path)/compile_commands.json
4141
CMakeUserPresets.json:: cmake/CMakeUserPresets.json
4242
-ln -fs $< $@
4343

44+
find_package_test: # XXX install ## Test with installed cmake config package
45+
cmake -S examples -B build/find_package_test -G Ninja \
46+
-D CMAKE_CXX_STANDARD=26 \
47+
-D CMAKE_BUILD_TYPE=Release \
48+
-D CMAKE_SKIP_TEST_ALL_DEPENDENCY=OFF \
49+
--debug-find-pkg=beman.execution
50+
ninja -C build/find_package_test test
51+
ninja -C build/find_package_test ninja -t deps | egrep -w '(cmake_cxx_std|beman)'
52+
ninja -C build/find_package_test -t commands beman_execution.example.modules | tail -1
53+
4454
distclean: ## Remove all build artifacts
4555
rm -rf build .cache
4656
rm -f CMakeUserPresets.json \
@@ -49,8 +59,9 @@ distclean: ## Remove all build artifacts
4959
find . -name '*~' -delete
5060

5161
format: distclean ## Format all files with pre-commit
52-
-pre-commit autoupdate
53-
pre-commit run --all
62+
git ls-files ':(top,exclude)infra/cmake/' ::cmake.in ::*.cmake ::*CMakeLists.txt | xargs gersemi -i
63+
# -pre-commit autoupdate --freeze
64+
# pre-commit run --all
5465

5566
dockerbuild: ## Start docker image interactive
5667
docker run -it -v $(CURDIR):/src $(IMAGE)

‎cmake/CMakeUserPresets.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"configurePreset": "release",
2323
"configuration": "Release",
2424
"targets": [
25-
"all_verify_interface_header_sets",
2625
"all"
2726
]
2827
}

‎examples/CMakeLists.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
# gersemi: on
55

6-
cmake_minimum_required(VERSION 3.30...4.4)
6+
cmake_minimum_required(VERSION 3.30...4.5)
77

88
include(../cmake/prelude.cmake)
99

@@ -38,8 +38,7 @@ set(EXAMPLES
3838
)
3939

4040
if(BEMAN_USE_MODULES)
41-
#-dk:TODO gcc doesn't like the modules: list(APPEND EXAMPLES modules modules_and_header)
42-
list(APPEND EXAMPLES modules_and_header)
41+
list(APPEND EXAMPLES modules modules_and_header)
4342
endif()
4443

4544
if(BEMAN_EXECUTION_WITH_DEFAULT_PARALLEL_SCHEDULER_BACKEND)

0 commit comments

Comments
 (0)