mirror of
https://github.com/BlackMATov/kari.hpp.git
synced 2025-12-13 04:56:49 +07:00
update build/install scripts (copy from meta.hpp)
This commit is contained in:
44
.github/workflows/darwin.yml
vendored
44
.github/workflows/darwin.yml
vendored
@@ -9,23 +9,29 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
# https://github.com/actions/virtual-environments/tree/main/images/macos
|
# https://github.com/actions/virtual-environments/tree/main/images/macos
|
||||||
- { os: "macos-10.15", xcode: "10.3", arch: "x64" }
|
- { os: "macos-13", xcode: "14.3.1", arch: "x64" }
|
||||||
- { os: "macos-12", xcode: "14.2", arch: "x64" }
|
- { os: "macos-13", xcode: "14.3.1", arch: "arm64" }
|
||||||
name: "xcode-${{matrix.config.xcode}}"
|
- { os: "macos-14", xcode: "15.4", arch: "x64" }
|
||||||
|
- { os: "macos-14", xcode: "15.4", arch: "arm64" }
|
||||||
|
- { os: "macos-15", xcode: "16.2", arch: "x64" }
|
||||||
|
- { os: "macos-15", xcode: "16.2", arch: "arm64" }
|
||||||
|
name: "xcode-${{matrix.config.xcode}}-${{matrix.config.arch}}"
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: brew install cmake ninja
|
run: |
|
||||||
- name: Checkout
|
brew update
|
||||||
uses: actions/checkout@v3
|
brew install cmake ninja
|
||||||
with:
|
- name: Checkout
|
||||||
submodules: true
|
uses: actions/checkout@v4
|
||||||
- name: Select Xcode
|
with:
|
||||||
run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app"
|
submodules: true
|
||||||
- name: Build
|
- name: Select Xcode
|
||||||
run: |
|
run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app"
|
||||||
cmake --preset macos-${{matrix.config.arch}}
|
- name: Build
|
||||||
cmake --build --preset macos-${{matrix.config.arch}}-release
|
run: |
|
||||||
- name: Test
|
cmake --preset macos-${{matrix.config.arch}}
|
||||||
run: |
|
cmake --build --preset macos-${{matrix.config.arch}}-release
|
||||||
ctest --preset macos-${{matrix.config.arch}}-release
|
- name: Test
|
||||||
|
run: |
|
||||||
|
ctest --preset macos-${{matrix.config.arch}}
|
||||||
|
|||||||
38
.github/workflows/linux.yml
vendored
38
.github/workflows/linux.yml
vendored
@@ -9,23 +9,25 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
# https://github.com/actions/virtual-environments/tree/main/images/linux
|
# https://github.com/actions/runner-images/tree/main/images/ubuntu
|
||||||
- { os: "ubuntu-20.04", cc: "gcc-7", cxx: "g++-7" }
|
- { os: "ubuntu-20.04", cc: "gcc-10", cxx: "g++-10" }
|
||||||
- { os: "ubuntu-20.04", cc: "clang-7", cxx: "clang++-7" }
|
- { os: "ubuntu-20.04", cc: "clang-10", cxx: "clang++-10" }
|
||||||
- { os: "ubuntu-22.04", cc: "gcc-12", cxx: "g++-12" }
|
- { os: "ubuntu-24.04", cc: "gcc-14", cxx: "g++-14" }
|
||||||
- { os: "ubuntu-22.04", cc: "clang-14", cxx: "clang++-14" }
|
- { os: "ubuntu-24.04", cc: "clang-18", cxx: "clang++-18" }
|
||||||
name: "${{matrix.config.cxx}}"
|
name: "${{matrix.config.cxx}}"
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: sudo apt-get -y install cmake ninja-build ${{matrix.config.cc}} ${{matrix.config.cxx}}
|
run: |
|
||||||
- name: Checkout
|
sudo apt-get update -o Acquire::Retries=10
|
||||||
uses: actions/checkout@v3
|
sudo apt-get install -o Acquire::Retries=10 -y cmake ninja-build ${{matrix.config.cc}} ${{matrix.config.cxx}}
|
||||||
with:
|
- name: Checkout
|
||||||
submodules: true
|
uses: actions/checkout@v4
|
||||||
- name: Build
|
with:
|
||||||
run: |
|
submodules: true
|
||||||
cmake --preset linux-${{matrix.config.cc}}
|
- name: Build
|
||||||
cmake --build --preset linux-${{matrix.config.cc}}-release
|
run: |
|
||||||
- name: Test
|
cmake --preset linux-${{matrix.config.cc}}
|
||||||
run: |
|
cmake --build --preset linux-${{matrix.config.cc}}-release
|
||||||
ctest --preset linux-${{matrix.config.cc}}-release
|
- name: Test
|
||||||
|
run: |
|
||||||
|
ctest --preset linux-${{matrix.config.cc}}
|
||||||
|
|||||||
42
.github/workflows/windows.yml
vendored
42
.github/workflows/windows.yml
vendored
@@ -9,25 +9,25 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
# https://github.com/actions/virtual-environments/tree/main/images/win
|
# https://github.com/actions/runner-images/tree/main/images/windows
|
||||||
- { os: "windows-2019", vc: "msvc2019", arch: "x86" }
|
- { os: "windows-2019", vc: "msvc2019", arch: "x86" }
|
||||||
- { os: "windows-2019", vc: "msvc2019", arch: "x64" }
|
- { os: "windows-2019", vc: "msvc2019", arch: "x64" }
|
||||||
- { os: "windows-2022", vc: "msvc2022", arch: "x86" }
|
- { os: "windows-2022", vc: "msvc2022", arch: "x86" }
|
||||||
- { os: "windows-2022", vc: "msvc2022", arch: "x64" }
|
- { os: "windows-2022", vc: "msvc2022", arch: "x64" }
|
||||||
name: "${{matrix.config.vc}} ${{matrix.config.arch}}"
|
name: "${{matrix.config.vc}}-${{matrix.config.arch}}"
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: choco install cmake ninja
|
run: choco install cmake ninja
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Select MSVC
|
- name: Select MSVC
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}
|
cmake --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}
|
||||||
cmake --build --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release
|
cmake --build --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
ctest --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release
|
ctest --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}
|
||||||
|
|||||||
5
.vscode/launch.json
vendored
5
.vscode/launch.json
vendored
@@ -6,6 +6,9 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${command:cmake.launchTargetPath}",
|
"program": "${command:cmake.launchTargetPath}",
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}",
|
||||||
|
"initCommands": [
|
||||||
|
"settings set target.process.thread.step-avoid-regexp \"\""
|
||||||
|
]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|||||||
22
.vscode/settings.json
vendored
22
.vscode/settings.json
vendored
@@ -1,29 +1,13 @@
|
|||||||
{
|
{
|
||||||
"[cpp]": {
|
"[c][cmake][cpp][json][jsonc][markdown][python][yaml]": {
|
||||||
"files.encoding": "utf8",
|
|
||||||
"files.insertFinalNewline": true,
|
|
||||||
"files.trimFinalNewlines": true,
|
|
||||||
"files.trimTrailingWhitespace": true
|
|
||||||
},
|
|
||||||
"[cmake]": {
|
|
||||||
"files.encoding": "utf8",
|
|
||||||
"files.insertFinalNewline": true,
|
|
||||||
"files.trimFinalNewlines": true,
|
|
||||||
"files.trimTrailingWhitespace": true
|
|
||||||
},
|
|
||||||
"[python]": {
|
|
||||||
"files.encoding": "utf8",
|
"files.encoding": "utf8",
|
||||||
"files.insertFinalNewline": true,
|
"files.insertFinalNewline": true,
|
||||||
"files.trimFinalNewlines": true,
|
"files.trimFinalNewlines": true,
|
||||||
"files.trimTrailingWhitespace": true
|
"files.trimTrailingWhitespace": true
|
||||||
},
|
},
|
||||||
"clangd.arguments": [
|
"clangd.arguments": [
|
||||||
"--all-scopes-completion",
|
"--header-insertion=never",
|
||||||
"--background-index",
|
"--compile-commands-dir=${workspaceFolder}/.clangd"
|
||||||
"--clang-tidy",
|
|
||||||
"--compile-commands-dir=${workspaceFolder}/.clangd",
|
|
||||||
"--completion-style=detailed",
|
|
||||||
"--header-insertion=never"
|
|
||||||
],
|
],
|
||||||
"cmake.copyCompileCommands": "${workspaceFolder}/.clangd/compile_commands.json"
|
"cmake.copyCompileCommands": "${workspaceFolder}/.clangd/compile_commands.json"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
|
|||||||
project(kari.hpp
|
project(kari.hpp
|
||||||
VERSION "0.0.1"
|
VERSION "0.0.1"
|
||||||
DESCRIPTION "Experimental library for currying in C++17"
|
DESCRIPTION "Experimental library for currying in C++17"
|
||||||
HOMEPAGE_URL "https://github.com/blackmatov/kari.hpp")
|
HOMEPAGE_URL "https://github.com/blackmatov/kari.hpp"
|
||||||
|
LANGUAGES CXX)
|
||||||
|
|
||||||
#
|
option(KARI_HPP_DEVELOP "Generate develop targets" OFF)
|
||||||
# LIBRARY
|
option(KARI_HPP_INSTALL "Generate install targets" ${PROJECT_IS_TOP_LEVEL})
|
||||||
#
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} INTERFACE)
|
add_library(${PROJECT_NAME} INTERFACE)
|
||||||
add_library(kari.hpp::kari.hpp ALIAS ${PROJECT_NAME})
|
add_library(kari.hpp::kari.hpp ALIAS ${PROJECT_NAME})
|
||||||
@@ -19,11 +19,17 @@ target_include_directories(${PROJECT_NAME} INTERFACE
|
|||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/headers>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/headers>
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||||
|
|
||||||
#
|
if(KARI_HPP_DEVELOP)
|
||||||
# INSTALL
|
enable_testing()
|
||||||
#
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
if(PROJECT_IS_TOP_LEVEL)
|
add_subdirectory(vendors)
|
||||||
|
add_subdirectory(untests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(KARI_HPP_INSTALL)
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
@@ -31,31 +37,29 @@ if(PROJECT_IS_TOP_LEVEL)
|
|||||||
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||||
|
|
||||||
set(KARI_HPP_INSTALL_CONFIG_INPUT
|
set(KARI_HPP_INSTALL_CONFIG_INPUT
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in")
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake.in")
|
||||||
|
|
||||||
set(KARI_HPP_INSTALL_GENERATED_CONFIG_CMAKE
|
set(KARI_HPP_INSTALL_CONFIG_CMAKE
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}-config.cmake")
|
"${CMAKE_CURRENT_BINARY_DIR}/configs/${PROJECT_NAME}-config.cmake")
|
||||||
|
|
||||||
set(KARI_HPP_INSTALL_GENERATED_CONFIG_VERSION_CMAKE
|
set(KARI_HPP_INSTALL_CONFIG_VERSION_CMAKE
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}-config-version.cmake")
|
"${CMAKE_CURRENT_BINARY_DIR}/configs/${PROJECT_NAME}-config-version.cmake")
|
||||||
|
|
||||||
configure_package_config_file(
|
configure_package_config_file(
|
||||||
"${KARI_HPP_INSTALL_CONFIG_INPUT}"
|
"${KARI_HPP_INSTALL_CONFIG_INPUT}"
|
||||||
"${KARI_HPP_INSTALL_GENERATED_CONFIG_CMAKE}"
|
"${KARI_HPP_INSTALL_CONFIG_CMAKE}"
|
||||||
INSTALL_DESTINATION "${KARI_HPP_INSTALL_CONFIG_DIR}"
|
INSTALL_DESTINATION "${KARI_HPP_INSTALL_CONFIG_DIR}"
|
||||||
NO_SET_AND_CHECK_MACRO
|
NO_SET_AND_CHECK_MACRO)
|
||||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
|
||||||
|
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"${KARI_HPP_INSTALL_GENERATED_CONFIG_VERSION_CMAKE}"
|
"${KARI_HPP_INSTALL_CONFIG_VERSION_CMAKE}"
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
COMPATIBILITY AnyNewerVersion
|
COMPATIBILITY AnyNewerVersion
|
||||||
ARCH_INDEPENDENT)
|
ARCH_INDEPENDENT)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS ${PROJECT_NAME}
|
TARGETS ${PROJECT_NAME}
|
||||||
EXPORT ${PROJECT_NAME}-targets
|
EXPORT ${PROJECT_NAME}-targets)
|
||||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY headers/${PROJECT_NAME}
|
DIRECTORY headers/${PROJECT_NAME}
|
||||||
@@ -68,28 +72,7 @@ if(PROJECT_IS_TOP_LEVEL)
|
|||||||
DESTINATION "${KARI_HPP_INSTALL_CONFIG_DIR}")
|
DESTINATION "${KARI_HPP_INSTALL_CONFIG_DIR}")
|
||||||
|
|
||||||
install(
|
install(
|
||||||
FILES "${KARI_HPP_INSTALL_GENERATED_CONFIG_CMAKE}"
|
FILES "${KARI_HPP_INSTALL_CONFIG_CMAKE}"
|
||||||
"${KARI_HPP_INSTALL_GENERATED_CONFIG_VERSION_CMAKE}"
|
"${KARI_HPP_INSTALL_CONFIG_VERSION_CMAKE}"
|
||||||
DESTINATION "${KARI_HPP_INSTALL_CONFIG_DIR}")
|
DESTINATION "${KARI_HPP_INSTALL_CONFIG_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
|
||||||
# DEVELOPER
|
|
||||||
#
|
|
||||||
|
|
||||||
if(PROJECT_IS_TOP_LEVEL)
|
|
||||||
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
|
||||||
option(BUILD_WITH_SANITIZERS "Build with sanitizers" OFF)
|
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
||||||
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake")
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
||||||
|
|
||||||
include(EnableASan)
|
|
||||||
include(EnableGCov)
|
|
||||||
include(EnableUBSan)
|
|
||||||
|
|
||||||
add_subdirectory(vendors)
|
|
||||||
add_subdirectory(untests)
|
|
||||||
endif()
|
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
{
|
{
|
||||||
"version": 3,
|
"version": 3,
|
||||||
|
|
||||||
"cmakeMinimumRequired": {
|
"cmakeMinimumRequired": {
|
||||||
"major": 3,
|
"major": 3,
|
||||||
"minor": 21,
|
"minor": 21,
|
||||||
"patch": 0
|
"patch": 0
|
||||||
},
|
},
|
||||||
|
|
||||||
"configurePresets": [
|
"configurePresets": [
|
||||||
{
|
{
|
||||||
"name": "ninja-base",
|
"name": "develop-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"generator": "Ninja Multi-Config",
|
"generator": "Ninja Multi-Config",
|
||||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/install/${presetName}",
|
"installDir": "${sourceDir}/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
|
"KARI_HPP_DEVELOP": true,
|
||||||
|
"KARI_HPP_INSTALL": true,
|
||||||
"CMAKE_EXPORT_COMPILE_COMMANDS": true
|
"CMAKE_EXPORT_COMPILE_COMMANDS": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-base",
|
"name": "linux-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"inherits": "ninja-base",
|
"inherits": "develop-base",
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
"lhs": "${hostSystemName}",
|
"lhs": "${hostSystemName}",
|
||||||
@@ -29,41 +29,41 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-7",
|
"name": "linux-clang-10",
|
||||||
"inherits": "linux-base",
|
"inherits": "linux-base",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-7",
|
"CMAKE_C_COMPILER": "clang-10",
|
||||||
"CMAKE_CXX_COMPILER": "clang++-7"
|
"CMAKE_CXX_COMPILER": "clang++-10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-14",
|
"name": "linux-clang-18",
|
||||||
"inherits": "linux-base",
|
"inherits": "linux-base",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang-14",
|
"CMAKE_C_COMPILER": "clang-18",
|
||||||
"CMAKE_CXX_COMPILER": "clang++-14"
|
"CMAKE_CXX_COMPILER": "clang++-18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-7",
|
"name": "linux-gcc-10",
|
||||||
"inherits": "linux-base",
|
"inherits": "linux-base",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "gcc-7",
|
"CMAKE_C_COMPILER": "gcc-10",
|
||||||
"CMAKE_CXX_COMPILER": "g++-7"
|
"CMAKE_CXX_COMPILER": "g++-10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-12",
|
"name": "linux-gcc-14",
|
||||||
"inherits": "linux-base",
|
"inherits": "linux-base",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "gcc-12",
|
"CMAKE_C_COMPILER": "gcc-14",
|
||||||
"CMAKE_CXX_COMPILER": "g++-12"
|
"CMAKE_CXX_COMPILER": "g++-14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "macos-base",
|
"name": "macos-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"inherits": "ninja-base",
|
"inherits": "develop-base",
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
"lhs": "${hostSystemName}",
|
"lhs": "${hostSystemName}",
|
||||||
@@ -78,13 +78,6 @@
|
|||||||
"strategy": "external"
|
"strategy": "external"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "macos-arm64-san",
|
|
||||||
"inherits": "macos-arm64",
|
|
||||||
"cacheVariables": {
|
|
||||||
"BUILD_WITH_SANITIZERS": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "macos-x64",
|
"name": "macos-x64",
|
||||||
"inherits": "macos-base",
|
"inherits": "macos-base",
|
||||||
@@ -93,17 +86,10 @@
|
|||||||
"strategy": "external"
|
"strategy": "external"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "macos-x64-san",
|
|
||||||
"inherits": "macos-x64",
|
|
||||||
"cacheVariables": {
|
|
||||||
"BUILD_WITH_SANITIZERS": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "windows-base",
|
"name": "windows-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"inherits": "ninja-base",
|
"inherits": "develop-base",
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
"lhs": "${hostSystemName}",
|
"lhs": "${hostSystemName}",
|
||||||
@@ -175,52 +161,51 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"buildPresets": [
|
"buildPresets": [
|
||||||
{
|
{
|
||||||
"name": "linux-clang-7-debug",
|
"name": "linux-clang-10-debug",
|
||||||
"configuration": "Debug",
|
"configuration": "Debug",
|
||||||
"configurePreset": "linux-clang-7"
|
"configurePreset": "linux-clang-10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-7-release",
|
"name": "linux-clang-10-release",
|
||||||
"configuration": "Release",
|
"configuration": "Release",
|
||||||
"configurePreset": "linux-clang-7"
|
"configurePreset": "linux-clang-10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-14-debug",
|
"name": "linux-clang-18-debug",
|
||||||
"configuration": "Debug",
|
"configuration": "Debug",
|
||||||
"configurePreset": "linux-clang-14"
|
"configurePreset": "linux-clang-18"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-14-release",
|
"name": "linux-clang-18-release",
|
||||||
"configuration": "Release",
|
"configuration": "Release",
|
||||||
"configurePreset": "linux-clang-14"
|
"configurePreset": "linux-clang-18"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-7-debug",
|
"name": "linux-gcc-10-debug",
|
||||||
"configuration": "Debug",
|
"configuration": "Debug",
|
||||||
"configurePreset": "linux-gcc-7"
|
"configurePreset": "linux-gcc-10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-7-release",
|
"name": "linux-gcc-10-release",
|
||||||
"configuration": "Release",
|
"configuration": "Release",
|
||||||
"configurePreset": "linux-gcc-7"
|
"configurePreset": "linux-gcc-10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-12-debug",
|
"name": "linux-gcc-14-debug",
|
||||||
"configuration": "Debug",
|
"configuration": "Debug",
|
||||||
"configurePreset": "linux-gcc-12"
|
"configurePreset": "linux-gcc-14"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-12-release",
|
"name": "linux-gcc-14-release",
|
||||||
"configuration": "Release",
|
"configuration": "Release",
|
||||||
"configurePreset": "linux-gcc-12"
|
"configurePreset": "linux-gcc-14"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "macos-arm64-debug",
|
"name": "macos-arm64-debug",
|
||||||
"configuration": "Debug",
|
"configuration": "Debug",
|
||||||
"configurePreset": "macos-arm64-san"
|
"configurePreset": "macos-arm64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "macos-arm64-release",
|
"name": "macos-arm64-release",
|
||||||
@@ -230,7 +215,7 @@
|
|||||||
{
|
{
|
||||||
"name": "macos-x64-debug",
|
"name": "macos-x64-debug",
|
||||||
"configuration": "Debug",
|
"configuration": "Debug",
|
||||||
"configurePreset": "macos-x64-san"
|
"configurePreset": "macos-x64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "macos-x64-release",
|
"name": "macos-x64-release",
|
||||||
@@ -278,63 +263,61 @@
|
|||||||
"configurePreset": "windows-x64-msvc2022"
|
"configurePreset": "windows-x64-msvc2022"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"testPresets": [
|
"testPresets": [
|
||||||
{
|
{
|
||||||
"name": "test-base",
|
"name": "test-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"output": {
|
"output": {
|
||||||
"verbosity": "verbose"
|
"verbosity": "verbose"
|
||||||
},
|
}
|
||||||
"configuration": "Release"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-7-release",
|
"name": "linux-clang-10",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "linux-clang-7"
|
"configurePreset": "linux-clang-10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-clang-14-release",
|
"name": "linux-clang-18",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "linux-clang-14"
|
"configurePreset": "linux-clang-18"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-7-release",
|
"name": "linux-gcc-10",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "linux-gcc-7"
|
"configurePreset": "linux-gcc-10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "linux-gcc-12-release",
|
"name": "linux-gcc-14",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "linux-gcc-12"
|
"configurePreset": "linux-gcc-14"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "macos-arm64-release",
|
"name": "macos-arm64",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "macos-arm64"
|
"configurePreset": "macos-arm64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "macos-x64-release",
|
"name": "macos-x64",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "macos-x64"
|
"configurePreset": "macos-x64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "windows-x86-msvc2019-release",
|
"name": "windows-x86-msvc2019",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "windows-x86-msvc2019"
|
"configurePreset": "windows-x86-msvc2019"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "windows-x64-msvc2019-release",
|
"name": "windows-x64-msvc2019",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "windows-x64-msvc2019"
|
"configurePreset": "windows-x64-msvc2019"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "windows-x86-msvc2022-release",
|
"name": "windows-x86-msvc2022",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "windows-x86-msvc2022"
|
"configurePreset": "windows-x86-msvc2022"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "windows-x64-msvc2022-release",
|
"name": "windows-x64-msvc2022",
|
||||||
"inherits": "test-base",
|
"inherits": "test-base",
|
||||||
"configurePreset": "windows-x64-msvc2022"
|
"configurePreset": "windows-x64-msvc2022"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
@PACKAGE_INIT@
|
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/kari.hpp-targets.cmake")
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# https://clang.llvm.org/docs/AddressSanitizer.html
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME}.enable_asan INTERFACE)
|
|
||||||
add_library(${PROJECT_NAME}::enable_asan ALIAS ${PROJECT_NAME}.enable_asan)
|
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME}.enable_asan INTERFACE
|
|
||||||
-fsanitize=address
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fsanitize-address-use-after-scope
|
|
||||||
-fsanitize-address-use-after-return=always)
|
|
||||||
|
|
||||||
target_link_options(${PROJECT_NAME}.enable_asan INTERFACE
|
|
||||||
-fsanitize=address
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
-fsanitize-address-use-after-scope
|
|
||||||
-fsanitize-address-use-after-return=always)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME}.enable_gcov INTERFACE)
|
|
||||||
add_library(${PROJECT_NAME}::enable_gcov ALIAS ${PROJECT_NAME}.enable_gcov)
|
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME}.enable_gcov INTERFACE
|
|
||||||
--coverage)
|
|
||||||
|
|
||||||
target_link_options(${PROJECT_NAME}.enable_gcov INTERFACE
|
|
||||||
--coverage)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME}.enable_ubsan INTERFACE)
|
|
||||||
add_library(${PROJECT_NAME}::enable_ubsan ALIAS ${PROJECT_NAME}.enable_ubsan)
|
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME}.enable_ubsan INTERFACE
|
|
||||||
-fsanitize=undefined
|
|
||||||
-fno-omit-frame-pointer)
|
|
||||||
|
|
||||||
target_link_options(${PROJECT_NAME}.enable_ubsan INTERFACE
|
|
||||||
-fsanitize=undefined
|
|
||||||
-fno-omit-frame-pointer)
|
|
||||||
4
cmake/config.cmake.in
Normal file
4
cmake/config.cmake.in
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
|
||||||
|
check_required_components(@PROJECT_NAME@)
|
||||||
@@ -1,68 +1,36 @@
|
|||||||
project(kari.hpp.untests)
|
project(kari.hpp.untests)
|
||||||
|
|
||||||
file(GLOB_RECURSE UNTESTS_SOURCES "*.cpp" "*.hpp")
|
file(GLOB_RECURSE UNTESTS_SOURCES CONFIGURE_DEPENDS "*.cpp" "*.hpp")
|
||||||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${UNTESTS_SOURCES})
|
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${UNTESTS_SOURCES})
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE kari.hpp::kari.hpp)
|
|
||||||
|
|
||||||
#
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
# setup defines
|
kari.hpp::kari.hpp
|
||||||
#
|
kari.hpp.vendors::doctest)
|
||||||
|
|
||||||
function(setup_defines_for_target TARGET)
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
target_compile_definitions(${TARGET} PRIVATE
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS
|
/WX /W4 /bigobj>
|
||||||
DOCTEST_CONFIG_USE_STD_HEADERS)
|
$<$<CXX_COMPILER_ID:GNU>:
|
||||||
endfunction()
|
-Werror -Wall -Wextra -Wpedantic
|
||||||
|
-Wno-inaccessible-base>
|
||||||
setup_defines_for_target(${PROJECT_NAME})
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
|
-Werror -Weverything -Wconversion
|
||||||
#
|
-Wno-c++98-compat
|
||||||
# setup libraries
|
-Wno-c++98-compat-pedantic
|
||||||
#
|
-Wno-exit-time-destructors
|
||||||
|
-Wno-global-constructors
|
||||||
function(setup_libraries_for_target TARGET)
|
-Wno-padded
|
||||||
target_link_libraries(${TARGET} PRIVATE doctest::doctest_with_main)
|
-Wno-poison-system-directories
|
||||||
|
-Wno-switch-default
|
||||||
if(${BUILD_WITH_COVERAGE})
|
-Wno-unknown-warning-option
|
||||||
target_link_libraries(${TARGET} PRIVATE kari.hpp::enable_gcov)
|
-Wno-unneeded-internal-declaration
|
||||||
endif()
|
-Wno-unsafe-buffer-usage
|
||||||
|
-Wno-unused-macros
|
||||||
if(${BUILD_WITH_SANITIZERS})
|
-Wno-unused-member-function
|
||||||
target_link_libraries(${TARGET} PRIVATE kari.hpp::enable_asan kari.hpp::enable_ubsan)
|
-Wno-weak-vtables
|
||||||
endif()
|
-Wno-zero-as-null-pointer-constant
|
||||||
endfunction()
|
>)
|
||||||
|
|
||||||
setup_libraries_for_target(${PROJECT_NAME})
|
|
||||||
|
|
||||||
#
|
|
||||||
# setup warnings
|
|
||||||
#
|
|
||||||
|
|
||||||
function(setup_warnings_for_target TARGET)
|
|
||||||
target_compile_options(${TARGET}
|
|
||||||
PRIVATE
|
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
|
||||||
/WX /W4>
|
|
||||||
PRIVATE
|
|
||||||
$<$<CXX_COMPILER_ID:GNU>:
|
|
||||||
-Werror -Wall -Wextra -Wpedantic>
|
|
||||||
PRIVATE
|
|
||||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
|
||||||
-Werror -Weverything -Wconversion
|
|
||||||
-Wno-c++98-compat
|
|
||||||
-Wno-c++98-compat-pedantic
|
|
||||||
-Wno-ctad-maybe-unsupported
|
|
||||||
-Wno-padded
|
|
||||||
-Wno-unknown-warning-option
|
|
||||||
>)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
setup_warnings_for_target(${PROJECT_NAME})
|
|
||||||
|
|
||||||
#
|
|
||||||
# add tests
|
|
||||||
#
|
|
||||||
|
|
||||||
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
||||||
|
|||||||
19
vendors/CMakeLists.txt
vendored
19
vendors/CMakeLists.txt
vendored
@@ -1,5 +1,18 @@
|
|||||||
project(kari.hpp.vendors)
|
project(kari.hpp.vendors)
|
||||||
|
|
||||||
set(DOCTEST_NO_INSTALL ON CACHE INTERNAL "")
|
add_library(${PROJECT_NAME}.doctest STATIC EXCLUDE_FROM_ALL doctest/doctest/parts/doctest.cpp)
|
||||||
add_subdirectory(doctest)
|
add_library(${PROJECT_NAME}::doctest ALIAS ${PROJECT_NAME}.doctest)
|
||||||
set_target_properties(doctest_with_main PROPERTIES FOLDER kari.hpp.vendors)
|
|
||||||
|
target_compile_features(${PROJECT_NAME}.doctest
|
||||||
|
PUBLIC cxx_std_20)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME}.doctest SYSTEM
|
||||||
|
PUBLIC doctest)
|
||||||
|
|
||||||
|
target_compile_definitions(${PROJECT_NAME}.doctest
|
||||||
|
PRIVATE
|
||||||
|
DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||||
|
PUBLIC
|
||||||
|
DOCTEST_CONFIG_USE_STD_HEADERS
|
||||||
|
$<$<BOOL:${BUILD_WITH_NO_EXCEPTIONS}>:
|
||||||
|
DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS>)
|
||||||
|
|||||||
Reference in New Issue
Block a user