Skip to content
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

Fix issues #47

Merged
merged 39 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9c06fb4
Prepare for new work
steve-downey Jul 20, 2024
b3e5a92
Update to googletest 1.15
steve-downey Jul 20, 2024
934adb8
Merge pull request #3 from steve-downey/gtest1.15
steve-downey Jul 20, 2024
9f574aa
Ctest requires CONFIG to run the tests
steve-downey Jul 20, 2024
f4e3a38
Regularize names
steve-downey Jul 20, 2024
6ce93d2
Merge pull request #5 from steve-downey/reserved-names
steve-downey Jul 20, 2024
87d3655
Add constexpr tests
steve-downey Jul 21, 2024
615006f
Use consteval function to check comparisons
steve-downey Jul 21, 2024
783a7e3
Merge pull request #6 from steve-downey/constexpr
steve-downey Jul 21, 2024
a925138
Add constexpr to swap and emplace
steve-downey Jul 21, 2024
f00fe6d
Merge pull request #7 from steve-downey/swap-emplace
steve-downey Jul 21, 2024
01a0815
Make assignment operators constexpr
steve-downey Jul 21, 2024
bc1bab9
Merge pull request #8 from steve-downey/assignment-constexp
steve-downey Jul 21, 2024
767b411
Fix or_else operations
steve-downey Jul 21, 2024
1f1bbcf
Merge pull request #9 from steve-downey/monadic-constexpr
steve-downey Jul 21, 2024
4cd7a0b
Use static assert to mandate T not nullopt_t
steve-downey Jul 22, 2024
ad16f18
Merge pull request #10 from steve-downey/prim_constrain
steve-downey Jul 22, 2024
27a2aba
Apply 'Mandates' as static_asserts
steve-downey Jul 22, 2024
7964de0
Merge pull request #11 from steve-downey/mandates
steve-downey Jul 22, 2024
2e614ff
Make `in_place` inline not static
steve-downey Jul 22, 2024
e56f223
Use local in_place and nullopt
steve-downey Jul 22, 2024
c4c6bda
Merge pull request #12 from steve-downey/in_place
steve-downey Jul 22, 2024
d4b05f5
Change is_optional to a variable template
steve-downey Jul 22, 2024
961552d
Merge pull request #13 from steve-downey/is_optional
steve-downey Jul 22, 2024
d421c70
Enable GCC 12 and 11 in CI
steve-downey Jul 22, 2024
0d636aa
Merge pull request #14 from steve-downey/older-gcc
steve-downey Jul 22, 2024
b3a687a
Use shared test utility types
steve-downey Jul 27, 2024
739adba
Clean up warnings
steve-downey Jul 28, 2024
1cbbb87
Use constify to clean up constexpr comparison tests
steve-downey Jul 28, 2024
27b8683
The function that transform takes returns obj or ref
steve-downey Jul 28, 2024
571f38d
Format test_types.hpp
steve-downey Jul 28, 2024
bee18d8
Fix assignment of related optional
steve-downey Aug 2, 2024
39ed045
Missing anchor file for test_types
steve-downey Aug 4, 2024
58600ee
Fix construction from empty optional<U>
steve-downey Aug 9, 2024
1bf0ffd
The refref assignment is deleted
steve-downey Aug 12, 2024
6a83827
Add file header blocks to cpp files
steve-downey Aug 14, 2024
7635e76
Move test support types to test_types.
steve-downey Aug 15, 2024
51f1f2b
Move constify to own header
steve-downey Aug 15, 2024
d153523
Remove test that tests are run
steve-downey Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
- {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\" "}
# Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options.
- {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"}
- {name: "Ubuntu GCC 11", os: ubuntu-24.04, toolchain: "gcc-11", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
- {name: "Ubuntu GCC 12", os: ubuntu-24.04, toolchain: "gcc-12", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
- {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
- {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
steps:
Expand Down
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# cmake-format: off
# /CMakeLists.txt -*-makefile-*-
# CMakeLists.txt -*-CMake-*-
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

cmake_minimum_required(VERSION 3.27)

Expand All @@ -22,7 +21,7 @@ if(BUILD_TESTING)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
GIT_TAG e39786088138f2749d64e9e90e0f9902daa77c40 # release-1.15.0
)
FetchContent_MakeAvailable(googletest)
endif()
Expand Down
97 changes: 97 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#! /usr/bin/make -f
# cmake-format: off
# /Makefile -*-makefile-*-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

INSTALL_PREFIX?=.install/
PROJECT?=$(shell basename $(CURDIR))
BUILD_DIR?=.build
DEST?=$(INSTALL_PREFIX)
CMAKE_FLAGS?=

TARGETS := test clean all ctest

export

.update-submodules:
git submodule update --init --recursive
touch .update-submodules

.gitmodules: .update-submodules

CONFIG?=Asan

export

ifeq ($(strip $(TOOLCHAIN)),)
_build_name?=build-system/
_build_dir?=.build/
_configuration_types?="RelWithDebInfo;Debug;Tsan;Asan"
_cmake_args=-DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/etc/toolchain.cmake
else
_build_name?=build-$(TOOLCHAIN)
_build_dir?=.build/
_configuration_types?="RelWithDebInfo;Debug;Tsan;Asan"
_cmake_args=-DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/etc/$(TOOLCHAIN)-toolchain.cmake
endif


_build_path?=$(_build_dir)/$(_build_name)

define run_cmake =
cmake \
-G "Ninja Multi-Config" \
-DCMAKE_CONFIGURATION_TYPES=$(_configuration_types) \
-DCMAKE_INSTALL_PREFIX=$(abspath $(INSTALL_PREFIX)) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
$(_cmake_args) \
$(CURDIR)
endef

default: test

$(_build_path):
mkdir -p $(_build_path)

$(_build_path)/CMakeCache.txt: | $(_build_path) .gitmodules
cd $(_build_path) && $(run_cmake)
-rm compile_commands.json
ln -s $(_build_path)/compile_commands.json

compile: $(_build_path)/CMakeCache.txt ## Compile the project
cmake --build $(_build_path) --config $(CONFIG) --target all -- -k 0

install: $(_build_path)/CMakeCache.txt ## Install the project
DESTDIR=$(abspath $(DEST)) ninja -C $(_build_path) -k 0 install

ctest: $(_build_path)/CMakeCache.txt ## Run CTest on current build
cd $(_build_path) && ctest --output-on-failure

ctest_ : compile
cd $(_build_path) && ctest -C $(CONFIG) --output-on-failure

test: ctest_ ## Rebuild and run tests

cmake: | $(_build_path)
cd $(_build_path) && ${run_cmake}

clean: $(_build_path)/CMakeCache.txt ## Clean the build artifacts
cmake --build $(_build_path) --config $(CONFIG) --target clean

realclean: ## Delete the build directory
rm -rf $(_build_path)

env:
$(foreach v, $(.VARIABLES), $(info $(v) = $($(v))))

.PHONY : compile install ctest ctest_ test cmake clean realclean env

.PHONY: papers
papers:
$(MAKE) -C papers papers

# Help target
.PHONY: help
help: ## Show this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) targets.mk | sort
6 changes: 6 additions & 0 deletions etc/gcc-15-toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include_guard(GLOBAL)

include("${CMAKE_CURRENT_LIST_DIR}/gcc-flags.cmake")

set(CMAKE_C_COMPILER gcc-15)
set(CMAKE_CXX_COMPILER g++-15)
Loading
Loading