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
100 changes: 1 addition & 99 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -66,104 +66,6 @@ ForEachMacros:
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"[a-zA-Z0-9_]*\.'
Priority: 1
SortPriority: 1
- Regex: '^"testutils/'
Priority: 2
SortPriority: 2
- Regex: '^"tron/'
Priority: 2
SortPriority: 3
- Regex: '^"fmi/'
Priority: 2
SortPriority: 4
- Regex: '^"verifier/'
Priority: 2
SortPriority: 5
- Regex: '^"cora/'
Priority: 2
SortPriority: 6
- Regex: '^"tiga/'
Priority: 2
SortPriority: 7
- Regex: '^"statmc/'
Priority: 2
SortPriority: 8
- Regex: '^"xmltrace/'
Priority: 2
SortPriority: 9
- Regex: '^"pipeline/'
Priority: 2
SortPriority: 10
- Regex: '^"protocol/'
Priority: 2
SortPriority: 11
- Regex: '^"storage/'
Priority: 2
SortPriority: 12
- Regex: '^"system/'
Priority: 2
SortPriority: 13
- Regex: '^"dbm/'
Priority: 2
SortPriority: 14
- Regex: '^"cdd/'
Priority: 2
SortPriority: 15
- Regex: '^"polyhedra/'
Priority: 2
SortPriority: 16
- Regex: '^"tracer/'
Priority: 2
SortPriority: 17
- Regex: '^"utap/'
Priority: 2
SortPriority: 18
- Regex: '^"io/'
Priority: 2
SortPriority: 19
- Regex: '^"formats/'
Priority: 2
SortPriority: 20
- Regex: '^"base/'
Priority: 2
SortPriority: 21
- Regex: '^"hash/'
Priority: 2
SortPriority: 22
- Regex: '^"debug/'
Priority: 2
SortPriority: 23
- Regex: '^<libstrategy/'
Priority: 3
SortPriority: 24
- Regex: '^<licensing/'
Priority: 3
SortPriority: 25
- Regex: '^<prlearn/'
Priority: 3
SortPriority: 26
- Regex: '^<ap_'
Priority: 3
SortPriority: 27
- Regex: '^<libxml/'
Priority: 3
SortPriority: 28
- Regex: '^<doctest/'
Priority: 3
SortPriority: 30
- Regex: '^<boost/'
Priority: 3
SortPriority: 30
- Regex: '^<[a-bd-z0-9][a-z0-9_]*(\.[a-z]*)?>$'
Priority: 4
SortPriority: 31
- Regex: '^<c'
Priority: 4
SortPriority: 32
#IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 4
Expand Down Expand Up @@ -216,7 +118,7 @@ RawStringFormats:
- ParseTextProtoOrDie
CanonicalDelimiter: ''
ReflowComments: true
SortIncludes: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
Expand Down
114 changes: 80 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build and Test

on:
Expand All @@ -7,50 +8,95 @@ on:
branches: [ main ]

jobs:
format:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Format
run: find src include test -iregex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|hxx\)$' | xargs clang-format -n -Werror
- uses: actions/checkout@v3
- name: Formatting
run: find src include test -iregex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|hxx\)$' | xargs clang-format -n -Werror
build-linux:
runs-on: ubuntu-latest
env:
TARGET: x86_64-linux
CMAKE_BUILD_TYPE: Debug
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v2
- name: Get dependencies
run: sudo apt-get update && sudo apt-get install libboost-all-dev doctest-dev && ./getlibs.sh
- name: Build and test
run: |
export CTEST_OUTPUT_ON_FAILURE=1
cmake -DTESTING=yes . -B build
cmake --build build
(cd build ; ctest)
- uses: actions/checkout@v3
- name: Setup the toolchain
run: |
CMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/cmake/toolchain/${{ env.TARGET }}.cmake"
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
# - name: Build without getlibs
# run: |
# BUILD=build-$TARGET-$CMAKE_BUILD_TYPE
# cmake -B $BUILD
# cmake --build $BUILD --config $CMAKE_BUILD_TYPE
# ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
- name: Get dependencies
run: CMAKE_BUILD_TYPE=Release ./getlibs.sh $TARGET
- name: Build with getlibs
run: |
BUILD=build-$TARGET-libs-$CMAKE_BUILD_TYPE
cmake -B $BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/$TARGET"
cmake --build $BUILD --config $CMAKE_BUILD_TYPE
ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
build-win:
runs-on: ubuntu-latest
env:
TARGET: x86_64-w64-mingw32
WINARCH: win64
CMAKE_BUILD_TYPE: Debug
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v2
- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install cmake make g++-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-tools wine wine-binfmt
- uses: actions/checkout@v3
- name: Setup the toolchain
run: |
sudo apt-get -qqy update
sudo apt-get -qqy install cmake make g++-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-tools wine wine-binfmt
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
CMAKE_TOOLCHAIN_FILE="$(pwd)/toolchains/x86_64-w64-mingw32.cmake" ./getlibs.sh
- name: Build and test
run: |
export CTEST_OUTPUT_ON_FAILURE=1
cmake -DSTATIC=yes -DTESTING=yes -DCMAKE_TOOLCHAIN_FILE=toolchains/x86_64-w64-mingw32.cmake . -B build
cmake --build build
(cd build ; ctest)
WINEPATH=$(${{ github.workspace }}/winepath-for $TARGET)
echo "WINEPATH=$WINEPATH" >> $GITHUB_ENV
CMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/cmake/toolchain/${{ env.TARGET }}.cmake"
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
# - name: Build without getlibs
# run: |
# BUILD=build-$TARGET-$CMAKE_BUILD_TYPE
# cmake -S . -B $BUILD -DSTATIC=yes
# cmake --build $BUILD --config $CMAKE_BUILD_TYPE
# ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
- name: Get dependencies
run:
CMAKE_BUILD_TYPE=Release ./getlibs.sh $TARGET
- name: Build with getlibs
run: |
BUILD=build-$TARGET-libs-$CMAKE_BUILD_TYPE
cmake -B $BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/$TARGET" -DSTATIC=yes
cmake --build $BUILD --config $CMAKE_BUILD_TYPE
ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
build-macos:
runs-on: macos-latest
env:
TARGET: x86_64-darwin
CMAKE_BUILD_TYPE: Debug
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v2
- name: Get dependencies
run: brew install boost doctest && ./getlibs.sh
- name: Build and test
run: |
export CTEST_OUTPUT_ON_FAILURE=1
cmake -DTESTING=yes . -B build
cmake --build build
(cd build ; ctest)
- uses: actions/checkout@v3
- name: Setup the toolchain
run: |
CMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/cmake/toolchain/$TARGET.cmake"
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
# - name: Build without getlibs
# run: |
# BUILD=build-$TARGET-$CMAKE_BUILD_TYPE
# cmake -B $BUILD
# cmake --build $BUILD --config $CMAKE_BUILD_TYPE
# ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
- name: Get dependencies
run: CMAKE_BUILD_TYPE=Release ./getlibs.sh $TARGET
- name: Build with getlibs
run: |
BUILD=build-$TARGET-libs-$CMAKE_BUILD_TYPE
cmake -S . -B $BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/$TARGET"
cmake --build $BUILD --config $CMAKE_BUILD_TYPE
ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ build*
cmake-build*

# Getlibs
/libs
/libs-i686-linux
/libs-x86_64-w64-mingw32
/libs-i686-w64-mingw32
local

# Prerequisites
*.d
Expand Down
61 changes: 21 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
cmake_minimum_required(VERSION 3.15)
project(UCDD VERSION 0.2.1 LANGUAGES CXX C)
cmake_minimum_required(VERSION 3.30)
project(UCDD VERSION 0.2.2 LANGUAGES CXX C)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

option(TESTING "Unit tests" OFF)
option(ASAN "Address Sanitizer" OFF)
option(UCDD_WITH_TESTS "UCDD Unit tests" ON)
option(FIND_FATAL "Stop upon find_package errors" OFF)
include(cmake/sanitizer.cmake)

cmake_policy(SET CMP0048 NEW) # project() command manages VERSION variables
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(MULTI_TERMINAL 1)
CONFIGURE_FILE("src/config.h.cmake" "include/cdd/config.h")

if(CMAKE_TOOLCHAIN_FILE)
get_filename_component(TARGET ${CMAKE_TOOLCHAIN_FILE} NAME_WLE)
set(LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs-${TARGET}")
else(CMAKE_TOOLCHAIN_FILE)
set(LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs")
endif(CMAKE_TOOLCHAIN_FILE)
message(STATUS "Using libs in ${LIBS_DIR}")
if (UCDD_WITH_TESTS)
include(cmake/doctest.cmake)
enable_testing()
endif (UCDD_WITH_TESTS)

set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${LIBS_DIR}")
find_package(xxHash 0.8.0 REQUIRED COMPONENTS xxhash PATHS ${LIBS_DIR}/xxHash)
find_package(UUtils 1.1.1 REQUIRED PATHS ${LIBS_DIR}/UUtils)
find_package(UDBM 2.0.11 REQUIRED PATHS ${LIBS_DIR}/UDBM)

include_directories(
PRIVATE
# where the library itself will look for its internal headers
${CMAKE_BINARY_DIR}/include
PUBLIC
# where top-level project will look for the library's public headers
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
# where external projects will look for the library's public headers
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
include(cmake/xxhash.cmake)
include(cmake/UUtils.cmake)
include(cmake/UDBM.cmake)

if(STATIC)
# The project does not use neither threads nor networking, but
Expand All @@ -42,23 +31,15 @@ if(STATIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
endif(STATIC)

if (ASAN)
add_compile_options(-fno-omit-frame-pointer -fsanitize=address)
add_link_options(-fno-omit-frame-pointer -fsanitize=address)
message(STATUS "Using Address Sanitizer")
endif(ASAN)

add_subdirectory("src")

if(TESTING)
enable_testing()
if (UCDD_WITH_TESTS)
add_subdirectory("test")
endif(TESTING)
endif(UCDD_WITH_TESTS)

write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/UCDDConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion)
write_basic_package_version_file(${PROJECT_BINARY_DIR}/UCDDConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion)

install(DIRECTORY include DESTINATION .)
install(TARGETS UCDD EXPORT UCDDConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT UCDDConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UCDD)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/UCDDConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UCDD )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cdd/config.h DESTINATION include/cdd/)
install(FILES ${PROJECT_BINARY_DIR}/UCDDConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UCDD)
install(FILES ${PROJECT_BINARY_DIR}/include/cdd/config.h DESTINATION include/cdd/)
Loading