Repository navigation
Do not use EXCLUDE_FROM_ALL with FetchContent #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ClausKlein
wants to merge
8
commits into
main
Choose a base branch
from
feature/install_right
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0fe3d78
Do not use EXCLUDE_FROM_ALL with FetchContent
ClausKlein fb68e46
Make it works
ClausKlein 7b42456
format cmake files
ClausKlein f07b3ef
Now it works with and w/o vcpkg
ClausKlein 82243f6
Add find_packages_test
ClausKlein 3911cc0
Quickfix for CI builds
ClausKlein 841db84
Add find-package-test to ctest for release builds
ClausKlein 3ffc5ba
Add missing exports to GNUmakefile
ClausKlein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # GNUmakefile | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| MAKEFLAGS+= --no-builtin-rules # Disable the built-in implicit rules. | ||
| MAKEFLAGS+= --no-builtin-variables # Disable the built-in variable settings. | ||
| MAKEFLAGS+= --warn-undefined-variables # Warn when an undefined variable is referenced. | ||
| .SUFFIXES: # Disable all suffix rules. | ||
| ################################################## | ||
|
|
||
| ifeq ($(origin CXX),default) | ||
| export CXX:= g++-16 | ||
| export CC:= gcc-16 | ||
| endif | ||
|
|
||
| export CMAKE_PREFIX_PATH:=$(CURDIR)/stagedir:${CMAKE_PREFIX_PATH} | ||
|
|
||
| PRESET?=gcc-release | ||
| IMAGE?=ghcr.io/bemanproject/infra-containers-gcc:trunk | ||
|
|
||
| _build_path:=build/$(PRESET) | ||
|
|
||
| .PHONY: all check distclean format dockerbuild | ||
|
|
||
| # default target rule | ||
| all: .init compile_commands.json ## Make all with cmake workflow preset | ||
| cmake --workflow --preset $(PRESET) | ||
|
|
||
| .init: CMakeUserPresets.json CMakePresets.json CMakeLists.txt ## Configure cmake preset in VERBOSE mode | ||
| cmake --version | ||
| cmake --preset $(PRESET) \ | ||
| -D BEMAN_UTF_VIEW_USE_MODULES=ON \ | ||
| -D CMAKE_CXX_STANDARD=26 \ | ||
| -D CMAKE_PROJECT_TOP_LEVEL_INCLUDES=infra/cmake/use-fetch-content.cmake \ | ||
| --fresh --log-level=VERBOSE | ||
| touch $@ | ||
|
|
||
| check: .init compile_commands.json ## Run clang-tidy on examples | ||
| run-clang-tidy examples | ||
|
|
||
| .PHONY: compile_commands.json | ||
| compile_commands.json: $(_build_path)/compile_commands.json | ||
| if [ "X$(shell readlink compile_commands.json)" != "X$(_build_path)/compile_commands.json" ] ; then \ | ||
| ln -fs $< $@; \ | ||
| fi | ||
|
|
||
| CMakeUserPresets.json:: cmake/CMakeUserPresets.json | ||
| -ln -fs $< $@ | ||
|
|
||
| find_package_test: # XXX install ## Test with installed cmake config package | ||
| cmake -S examples -B build/find_package_test -G Ninja \ | ||
| -D BEMAN_UTF_VIEW_USE_MODULES=ON \ | ||
| -D CMAKE_CXX_STANDARD=26 \ | ||
| -D CMAKE_BUILD_TYPE=Release \ | ||
| -D CMAKE_SKIP_TEST_ALL_DEPENDENCY=OFF \ | ||
| --debug-find-pkg=beman.utf_view --debug-find-pkg=beman.transform_view | ||
| ninja -C build/find_package_test test | ||
| ninja -C build/find_package_test ninja -t deps | egrep -w '(cmake_cxx_std|beman)' | ||
| ninja -C build/find_package_test -t commands beman.utf_view.examples.null_term_argv_environ | tail -1 | ||
|
|
||
| distclean: ## Remove all build artifacts | ||
| rm -rf build .cache | ||
| rm -f CMakeUserPresets.json \ | ||
| compile_commands.json \ | ||
| .init | ||
| find . -name '*~' -delete | ||
|
|
||
| format: distclean ## Format all files with pre-commit | ||
| git ls-files ':(top,exclude)infra/cmake/' ::cmake.in ::*.cmake ::*CMakeLists.txt | xargs gersemi -i | ||
| # -pre-commit autoupdate --freeze | ||
| # pre-commit run --all | ||
|
|
||
| dockerbuild: ## Start docker image interactive | ||
| docker run -it -v $(CURDIR):/src $(IMAGE) | ||
|
|
||
| vcpkg: ## Check the vcpkg config usage | ||
| ${HOME}/vcpkg/bootstrap-vcpkg.sh | ||
| cmake -S triplets -B build/vcpkg-modules -G Ninja \ | ||
| -D CMAKE_CXX_STANDARD=26 \ | ||
| -D CMAKE_BUILD_TYPE=Release \ | ||
| -D CMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \ | ||
| -D VCPKG_OVERLAY_TRIPLETS="$(CURDIR)/triplets" \ | ||
| -D VCPKG_TARGET_TRIPLET=x64-osx-beman-modules | ||
| cmake --build build/vcpkg-modules | ||
| ctest --test-dir build/vcpkg-modules --output-on-failure | ||
|
|
||
| # Helper targets | ||
| .PHONY: env info | ||
|
|
||
| env: ## Show env | ||
| $(foreach v, $(.VARIABLES), $(info $(v) = $($(v)))) | ||
|
|
||
| info: ## Show this help. | ||
| @awk 'BEGIN {FS = ":.*?## "} /^[.a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | ||
|
|
||
| # NOTE: double-colon targets which has no prerequisites must always remade by gmake? | ||
| # Prerequisite 'GNUmakefile' is newer than target '.init'. | ||
| # -> Must remake target '.init'. | ||
| # NOTE: impizit handled by gmake! GNUmakefile :: ; | ||
| # NO if exists TODO(CK): cmake/CMakeUserPresets.json :: ; | ||
|
|
||
| # Anything we don't know how to build will use this rule. | ||
| % :: | ||
| ninja -C $(_build_path) $(@) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| // SPDX-License-Identifier: BSL-1.0 | ||
|
|
||
| module; | ||
|
|
||
| #include <beman/utf_view/detail/constexpr_unless_msvc.hpp> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # SPDX-License-Identifier: BSL-1.0 | ||
|
|
||
| cmake_minimum_required(VERSION 4.5) | ||
|
|
||
| project(utf_view_smoke LANGUAGES CXX) | ||
|
|
||
| enable_testing() | ||
|
|
||
| find_package(beman.utf_view 0.3.0 EXACT CONFIG REQUIRED) | ||
| message(STATUS "Using beman.utf_view config: ${beman.utf_view_CONFIG}") | ||
|
|
||
| add_executable(utf_view_smoke main.cpp) | ||
| set_target_properties( | ||
| utf_view_smoke | ||
| PROPERTIES CXX_STANDARD 26 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO | ||
| ) | ||
| target_link_libraries(utf_view_smoke PRIVATE beman::utf_view) | ||
|
|
||
| add_test(NAME utf_view_smoke COMMAND utf_view_smoke) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../CMakePresets.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../lockfile.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // SPDX-License-Identifier: BSL-1.0 | ||
|
|
||
| import std; | ||
| import beman.utf_view; | ||
|
|
||
| auto main() -> int | ||
| { | ||
| constexpr std::u8string_view input = u8"A\U0001F642"; | ||
| constexpr std::u16string_view expected = u"A\U0001F642"; | ||
|
|
||
| return std::ranges::equal(input | beman::utf_view::to_utf16, expected) ? 0 : 1; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../vcpkg-configuration.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "dependencies": [ | ||
| { | ||
| "name": "beman-utf-view", | ||
| "features": ["modules"] | ||
| }, | ||
| { | ||
| "name": "beman-transform-view", | ||
| "features": ["modules"] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # SPDX-License-Identifier: BSL-1.0 | ||
|
|
||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES x86_64) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXCLUDE_FROM_ALLprevent the installation target for the fetched projectGIT_SHALLOWsave disk space and time!