Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 28 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,39 +115,48 @@ jobs:

- compiler: "clang-cl"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++-cl"
cc: "clang-cl"
runs-on: "windows-2022"
b2-toolset: "clang-win"
generator-toolset: "ClangCL"
is-latest: true
name: "Windows-Clang"
is-earliest: true
name: "Windows-Clang: C++20"
shared: true
build-type: "Release"
build-cmake: true

- compiler: "mingw"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "g++"
cc: "gcc"
runs-on: "windows-2022"
b2-toolset: "gcc"
generator: "MinGW Makefiles"
is-latest: true
name: "MinGW (shared)"
is-earliest: true
name: "MinGW (shared): C++20"
shared: true
build-type: "Debug"
build-cmake: true

- compiler: "mingw"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "g++"
cc: "gcc"
runs-on: "windows-2022"
b2-toolset: "gcc"
generator: "MinGW Makefiles"
is-latest: true
name: "MinGW (static)"
is-earliest: true
name: "MinGW (static): C++20"
shared: false
build-type: "Release"
build-cmake: true
Expand All @@ -157,58 +166,68 @@ jobs:

- compiler: "apple-clang"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++"
cc: "clang"
runs-on: "macos-26"
b2-toolset: "clang"
is-latest: true
name: "Apple-Clang (macOS 26)"
name: "Apple-Clang (macOS 26): C++20"
shared: true
build-type: "Release"
build-cmake: true

- compiler: "apple-clang"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++"
cc: "clang"
runs-on: "macos-26"
b2-toolset: "clang"
is-latest: true
name: "Apple-Clang (macOS 26, ubsan)"
name: "Apple-Clang (macOS 26, ubsan): C++20"
shared: false
build-type: "RelWithDebInfo"
ubsan: true

- compiler: "apple-clang"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++"
cc: "clang"
runs-on: "macos-26"
b2-toolset: "clang"
is-latest: true
name: "Apple-Clang (macOS 26, asan)"
name: "Apple-Clang (macOS 26, asan): C++20"
shared: true
build-type: "RelWithDebInfo"
asan: true

- compiler: "apple-clang"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++"
cc: "clang"
runs-on: "macos-15"
b2-toolset: "clang"
name: "Apple-Clang (macOS 15)"
name: "Apple-Clang (macOS 15): C++20"
shared: false
build-type: "Release"
build-cmake: true

- compiler: "apple-clang"
version: "*"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++"
cc: "clang"
runs-on: "macos-14"
b2-toolset: "clang"
name: "Apple-Clang (macOS 14)"
name: "Apple-Clang (macOS 14): C++20"
shared: true
build-type: "Release"
build-cmake: true
Expand Down Expand Up @@ -421,7 +440,6 @@ jobs:
runs-on: "ubuntu-latest"
container: "ubuntu:22.04"
b2-toolset: "gcc"
is-earliest: true
name: "GCC 11: C++20"
shared: false
build-type: "Release"
Expand Down Expand Up @@ -613,33 +631,6 @@ jobs:
shared: true
build-type: "Release"

- compiler: "clang"
version: "13"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++-13"
cc: "clang-13"
runs-on: "ubuntu-latest"
container: "ubuntu:22.04"
b2-toolset: "clang"
name: "Clang 13: C++20"
shared: false
build-type: "Release"

- compiler: "clang"
version: "12"
cxxstd: "20"
latest-cxxstd: "20"
cxx: "clang++-12"
cc: "clang-12"
runs-on: "ubuntu-latest"
container: "ubuntu:22.04"
b2-toolset: "clang"
is-earliest: true
name: "Clang 12: C++20"
shared: true
build-type: "Release"

name: ${{ matrix.name }}
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.runs-on] }}
container:
Expand Down Expand Up @@ -768,7 +759,7 @@ jobs:
asan: ${{ matrix.asan }}
ubsan: ${{ matrix.ubsan }}
shared: ${{ matrix.shared }}
rtti: ${{ (matrix.is-latest && 'on,off') || 'on' }}
rtti: on
cxxflags: ${{ (matrix.asan && '-fsanitize-address-use-after-scope -fsanitize=pointer-subtract') || '' }}
user-config: ${{ (startsWith(matrix.runs-on, 'windows') && !matrix.skip-zlib && format('{0}/user-config.jam', steps.patch.outputs.workspace_root)) || '' }}
stop-on-error: true
Expand Down
18 changes: 18 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Look in context/ for information

# Cross-Platform Compilation

All code MUST compile and pass tests on ALL configurations in `.github/workflows/ci.yml`. This includes:

- Multiple compilers: MSVC, clang-cl, MinGW, Apple-Clang, GCC 11-15, Clang 14-20
- Multiple platforms: Windows, macOS, Linux
- Both 32-bit and 64-bit architectures
- C++20, C++23, and C++2c standards
- ASan and UBSan sanitizer builds
- Warnings treated as errors

Key portability rules:
- Use `std::size_t` for sizes, `std::uintptr_t` for pointer-to-integer casts
- Do not assume heap deallocation order matches allocation order
- Prefer standard C++ over compiler extensions
- Include what you use; don't rely on transitive includes
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR})
else ()
set(DEFAULT_BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
endif ()
set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use when running CMake from this directory")
set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use when running CMake from this directory.")

#-------------------------------------------------
#
Expand Down Expand Up @@ -228,3 +228,4 @@ endif ()
if (BOOST_CAPY_BUILD_EXAMPLES)
# add_subdirectory(example)
endif ()

3 changes: 2 additions & 1 deletion build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ project boost/capy

alias capy_sources : [ glob-tree-ex ./src : *.cpp ] ;

# Windows CNG library for bcrypt random number generation
# Windows CNG library for bcrypt random number generation.
lib bcrypt_sys : : <name>bcrypt ;

lib boost_capy
Expand Down Expand Up @@ -79,3 +79,4 @@ lib boost_capy_brotli
;

boost-install boost_capy boost_capy_zlib boost_capy_brotli ;

Loading
Loading