Skip to content

Commit af67bc6

Browse files
authored
Merge pull request bemanproject#47 from steve-downey/fix-issues
Fix issues
2 parents bfeb908 + d153523 commit af67bc6

17 files changed

+1764
-590
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
- {name: "Ubuntu Clang 18", os: ubuntu-24.04, toolchain: "clang-18", clang_version: 18, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
1717
# Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options.
1818
- {name: "Ubuntu Clang 19", os: ubuntu-24.04, toolchain: "clang-19", clang_version: 19, installed_clang_version: 17, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" ", asan_options: "new_delete_type_mismatch=0"}
19+
- {name: "Ubuntu GCC 11", os: ubuntu-24.04, toolchain: "gcc-11", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
20+
- {name: "Ubuntu GCC 12", os: ubuntu-24.04, toolchain: "gcc-12", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
1921
- {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
2022
- {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
2123
steps:

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# cmake-format: off
2-
# /CMakeLists.txt -*-makefile-*-
1+
# CMakeLists.txt -*-CMake-*-
2+
#
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4-
# cmake-format: on
54

65
cmake_minimum_required(VERSION 3.27)
76

@@ -22,7 +21,7 @@ if(BUILD_TESTING)
2221
FetchContent_Declare(
2322
googletest
2423
GIT_REPOSITORY https://github.com/google/googletest.git
25-
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
24+
GIT_TAG e39786088138f2749d64e9e90e0f9902daa77c40 # release-1.15.0
2625
)
2726
FetchContent_MakeAvailable(googletest)
2827
endif()

Makefile

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#! /usr/bin/make -f
2+
# cmake-format: off
3+
# /Makefile -*-makefile-*-
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
# cmake-format: on
6+
7+
INSTALL_PREFIX?=.install/
8+
PROJECT?=$(shell basename $(CURDIR))
9+
BUILD_DIR?=.build
10+
DEST?=$(INSTALL_PREFIX)
11+
CMAKE_FLAGS?=
12+
13+
TARGETS := test clean all ctest
14+
15+
export
16+
17+
.update-submodules:
18+
git submodule update --init --recursive
19+
touch .update-submodules
20+
21+
.gitmodules: .update-submodules
22+
23+
CONFIG?=Asan
24+
25+
export
26+
27+
ifeq ($(strip $(TOOLCHAIN)),)
28+
_build_name?=build-system/
29+
_build_dir?=.build/
30+
_configuration_types?="RelWithDebInfo;Debug;Tsan;Asan"
31+
_cmake_args=-DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/etc/toolchain.cmake
32+
else
33+
_build_name?=build-$(TOOLCHAIN)
34+
_build_dir?=.build/
35+
_configuration_types?="RelWithDebInfo;Debug;Tsan;Asan"
36+
_cmake_args=-DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/etc/$(TOOLCHAIN)-toolchain.cmake
37+
endif
38+
39+
40+
_build_path?=$(_build_dir)/$(_build_name)
41+
42+
define run_cmake =
43+
cmake \
44+
-G "Ninja Multi-Config" \
45+
-DCMAKE_CONFIGURATION_TYPES=$(_configuration_types) \
46+
-DCMAKE_INSTALL_PREFIX=$(abspath $(INSTALL_PREFIX)) \
47+
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
48+
$(_cmake_args) \
49+
$(CURDIR)
50+
endef
51+
52+
default: test
53+
54+
$(_build_path):
55+
mkdir -p $(_build_path)
56+
57+
$(_build_path)/CMakeCache.txt: | $(_build_path) .gitmodules
58+
cd $(_build_path) && $(run_cmake)
59+
-rm compile_commands.json
60+
ln -s $(_build_path)/compile_commands.json
61+
62+
compile: $(_build_path)/CMakeCache.txt ## Compile the project
63+
cmake --build $(_build_path) --config $(CONFIG) --target all -- -k 0
64+
65+
install: $(_build_path)/CMakeCache.txt ## Install the project
66+
DESTDIR=$(abspath $(DEST)) ninja -C $(_build_path) -k 0 install
67+
68+
ctest: $(_build_path)/CMakeCache.txt ## Run CTest on current build
69+
cd $(_build_path) && ctest --output-on-failure
70+
71+
ctest_ : compile
72+
cd $(_build_path) && ctest -C $(CONFIG) --output-on-failure
73+
74+
test: ctest_ ## Rebuild and run tests
75+
76+
cmake: | $(_build_path)
77+
cd $(_build_path) && ${run_cmake}
78+
79+
clean: $(_build_path)/CMakeCache.txt ## Clean the build artifacts
80+
cmake --build $(_build_path) --config $(CONFIG) --target clean
81+
82+
realclean: ## Delete the build directory
83+
rm -rf $(_build_path)
84+
85+
env:
86+
$(foreach v, $(.VARIABLES), $(info $(v) = $($(v))))
87+
88+
.PHONY : compile install ctest ctest_ test cmake clean realclean env
89+
90+
.PHONY: papers
91+
papers:
92+
$(MAKE) -C papers papers
93+
94+
# Help target
95+
.PHONY: help
96+
help: ## Show this help.
97+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) targets.mk | sort

etc/gcc-15-toolchain.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include_guard(GLOBAL)
2+
3+
include("${CMAKE_CURRENT_LIST_DIR}/gcc-flags.cmake")
4+
5+
set(CMAKE_C_COMPILER gcc-15)
6+
set(CMAKE_CXX_COMPILER g++-15)

0 commit comments

Comments
 (0)