Skip to content

Commit 27282c6

Browse files
Update dependencies and refactor the build scripts (#41)
- gcc-14 - doctest-2.4.11 - xxHash-0.8.3 - UUtils-2.0.7 - UDBM-2.0.15
2 parents ca2d7a0 + 32f470d commit 27282c6

27 files changed

+871
-310
lines changed

.clang-format

Lines changed: 1 addition & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -66,104 +66,6 @@ ForEachMacros:
6666
- Q_FOREACH
6767
- BOOST_FOREACH
6868
IncludeBlocks: Regroup
69-
IncludeCategories:
70-
- Regex: '^"[a-zA-Z0-9_]*\.'
71-
Priority: 1
72-
SortPriority: 1
73-
- Regex: '^"testutils/'
74-
Priority: 2
75-
SortPriority: 2
76-
- Regex: '^"tron/'
77-
Priority: 2
78-
SortPriority: 3
79-
- Regex: '^"fmi/'
80-
Priority: 2
81-
SortPriority: 4
82-
- Regex: '^"verifier/'
83-
Priority: 2
84-
SortPriority: 5
85-
- Regex: '^"cora/'
86-
Priority: 2
87-
SortPriority: 6
88-
- Regex: '^"tiga/'
89-
Priority: 2
90-
SortPriority: 7
91-
- Regex: '^"statmc/'
92-
Priority: 2
93-
SortPriority: 8
94-
- Regex: '^"xmltrace/'
95-
Priority: 2
96-
SortPriority: 9
97-
- Regex: '^"pipeline/'
98-
Priority: 2
99-
SortPriority: 10
100-
- Regex: '^"protocol/'
101-
Priority: 2
102-
SortPriority: 11
103-
- Regex: '^"storage/'
104-
Priority: 2
105-
SortPriority: 12
106-
- Regex: '^"system/'
107-
Priority: 2
108-
SortPriority: 13
109-
- Regex: '^"dbm/'
110-
Priority: 2
111-
SortPriority: 14
112-
- Regex: '^"cdd/'
113-
Priority: 2
114-
SortPriority: 15
115-
- Regex: '^"polyhedra/'
116-
Priority: 2
117-
SortPriority: 16
118-
- Regex: '^"tracer/'
119-
Priority: 2
120-
SortPriority: 17
121-
- Regex: '^"utap/'
122-
Priority: 2
123-
SortPriority: 18
124-
- Regex: '^"io/'
125-
Priority: 2
126-
SortPriority: 19
127-
- Regex: '^"formats/'
128-
Priority: 2
129-
SortPriority: 20
130-
- Regex: '^"base/'
131-
Priority: 2
132-
SortPriority: 21
133-
- Regex: '^"hash/'
134-
Priority: 2
135-
SortPriority: 22
136-
- Regex: '^"debug/'
137-
Priority: 2
138-
SortPriority: 23
139-
- Regex: '^<libstrategy/'
140-
Priority: 3
141-
SortPriority: 24
142-
- Regex: '^<licensing/'
143-
Priority: 3
144-
SortPriority: 25
145-
- Regex: '^<prlearn/'
146-
Priority: 3
147-
SortPriority: 26
148-
- Regex: '^<ap_'
149-
Priority: 3
150-
SortPriority: 27
151-
- Regex: '^<libxml/'
152-
Priority: 3
153-
SortPriority: 28
154-
- Regex: '^<doctest/'
155-
Priority: 3
156-
SortPriority: 30
157-
- Regex: '^<boost/'
158-
Priority: 3
159-
SortPriority: 30
160-
- Regex: '^<[a-bd-z0-9][a-z0-9_]*(\.[a-z]*)?>$'
161-
Priority: 4
162-
SortPriority: 31
163-
- Regex: '^<c'
164-
Priority: 4
165-
SortPriority: 32
166-
#IncludeIsMainRegex: '([-_](test|unittest))?$'
16769
IndentCaseLabels: false
16870
IndentPPDirectives: None
16971
IndentWidth: 4
@@ -216,7 +118,7 @@ RawStringFormats:
216118
- ParseTextProtoOrDie
217119
CanonicalDelimiter: ''
218120
ReflowComments: true
219-
SortIncludes: true
121+
SortIncludes: false
220122
SortUsingDeclarations: false
221123
SpaceAfterCStyleCast: false
222124
SpaceAfterLogicalNot: false

.github/workflows/build.yml

Lines changed: 80 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build and Test
23

34
on:
@@ -7,50 +8,95 @@ on:
78
branches: [ main ]
89

910
jobs:
10-
format:
11+
formatting:
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@v2
14-
- name: Format
15-
run: find src include test -iregex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|hxx\)$' | xargs clang-format -n -Werror
14+
- uses: actions/checkout@v3
15+
- name: Formatting
16+
run: find src include test -iregex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|hxx\)$' | xargs clang-format -n -Werror
1617
build-linux:
1718
runs-on: ubuntu-latest
19+
env:
20+
TARGET: x86_64-linux
21+
CMAKE_BUILD_TYPE: Debug
22+
CTEST_OUTPUT_ON_FAILURE: 1
1823
steps:
19-
- uses: actions/checkout@v2
20-
- name: Get dependencies
21-
run: sudo apt-get update && sudo apt-get install libboost-all-dev doctest-dev && ./getlibs.sh
22-
- name: Build and test
23-
run: |
24-
export CTEST_OUTPUT_ON_FAILURE=1
25-
cmake -DTESTING=yes . -B build
26-
cmake --build build
27-
(cd build ; ctest)
24+
- uses: actions/checkout@v3
25+
- name: Setup the toolchain
26+
run: |
27+
CMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/cmake/toolchain/${{ env.TARGET }}.cmake"
28+
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
29+
# - name: Build without getlibs
30+
# run: |
31+
# BUILD=build-$TARGET-$CMAKE_BUILD_TYPE
32+
# cmake -B $BUILD
33+
# cmake --build $BUILD --config $CMAKE_BUILD_TYPE
34+
# ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
35+
- name: Get dependencies
36+
run: CMAKE_BUILD_TYPE=Release ./getlibs.sh $TARGET
37+
- name: Build with getlibs
38+
run: |
39+
BUILD=build-$TARGET-libs-$CMAKE_BUILD_TYPE
40+
cmake -B $BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/$TARGET"
41+
cmake --build $BUILD --config $CMAKE_BUILD_TYPE
42+
ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
2843
build-win:
2944
runs-on: ubuntu-latest
45+
env:
46+
TARGET: x86_64-w64-mingw32
47+
WINARCH: win64
48+
CMAKE_BUILD_TYPE: Debug
49+
CTEST_OUTPUT_ON_FAILURE: 1
3050
steps:
31-
- uses: actions/checkout@v2
32-
- name: Get dependencies
33-
run: |
34-
sudo apt-get update
35-
sudo apt-get install cmake make g++-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-tools wine wine-binfmt
51+
- uses: actions/checkout@v3
52+
- name: Setup the toolchain
53+
run: |
54+
sudo apt-get -qqy update
55+
sudo apt-get -qqy install cmake make g++-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-tools wine wine-binfmt
3656
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
3757
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
38-
CMAKE_TOOLCHAIN_FILE="$(pwd)/toolchains/x86_64-w64-mingw32.cmake" ./getlibs.sh
39-
- name: Build and test
40-
run: |
41-
export CTEST_OUTPUT_ON_FAILURE=1
42-
cmake -DSTATIC=yes -DTESTING=yes -DCMAKE_TOOLCHAIN_FILE=toolchains/x86_64-w64-mingw32.cmake . -B build
43-
cmake --build build
44-
(cd build ; ctest)
58+
WINEPATH=$(${{ github.workspace }}/winepath-for $TARGET)
59+
echo "WINEPATH=$WINEPATH" >> $GITHUB_ENV
60+
CMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/cmake/toolchain/${{ env.TARGET }}.cmake"
61+
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
62+
# - name: Build without getlibs
63+
# run: |
64+
# BUILD=build-$TARGET-$CMAKE_BUILD_TYPE
65+
# cmake -S . -B $BUILD -DSTATIC=yes
66+
# cmake --build $BUILD --config $CMAKE_BUILD_TYPE
67+
# ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
68+
- name: Get dependencies
69+
run:
70+
CMAKE_BUILD_TYPE=Release ./getlibs.sh $TARGET
71+
- name: Build with getlibs
72+
run: |
73+
BUILD=build-$TARGET-libs-$CMAKE_BUILD_TYPE
74+
cmake -B $BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/$TARGET" -DSTATIC=yes
75+
cmake --build $BUILD --config $CMAKE_BUILD_TYPE
76+
ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
4577
build-macos:
4678
runs-on: macos-latest
79+
env:
80+
TARGET: x86_64-darwin
81+
CMAKE_BUILD_TYPE: Debug
82+
CTEST_OUTPUT_ON_FAILURE: 1
4783
steps:
48-
- uses: actions/checkout@v2
49-
- name: Get dependencies
50-
run: brew install boost doctest && ./getlibs.sh
51-
- name: Build and test
52-
run: |
53-
export CTEST_OUTPUT_ON_FAILURE=1
54-
cmake -DTESTING=yes . -B build
55-
cmake --build build
56-
(cd build ; ctest)
84+
- uses: actions/checkout@v3
85+
- name: Setup the toolchain
86+
run: |
87+
CMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/cmake/toolchain/$TARGET.cmake"
88+
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
89+
# - name: Build without getlibs
90+
# run: |
91+
# BUILD=build-$TARGET-$CMAKE_BUILD_TYPE
92+
# cmake -B $BUILD
93+
# cmake --build $BUILD --config $CMAKE_BUILD_TYPE
94+
# ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE
95+
- name: Get dependencies
96+
run: CMAKE_BUILD_TYPE=Release ./getlibs.sh $TARGET
97+
- name: Build with getlibs
98+
run: |
99+
BUILD=build-$TARGET-libs-$CMAKE_BUILD_TYPE
100+
cmake -S . -B $BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/$TARGET"
101+
cmake --build $BUILD --config $CMAKE_BUILD_TYPE
102+
ctest --test-dir $BUILD -C $CMAKE_BUILD_TYPE

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ build*
66
cmake-build*
77

88
# Getlibs
9-
/libs
10-
/libs-i686-linux
11-
/libs-x86_64-w64-mingw32
12-
/libs-i686-w64-mingw32
9+
local
1310

1411
# Prerequisites
1512
*.d

CMakeLists.txt

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
1-
cmake_minimum_required(VERSION 3.15)
2-
project(UCDD VERSION 0.2.1 LANGUAGES CXX C)
1+
cmake_minimum_required(VERSION 3.30)
2+
project(UCDD VERSION 0.2.2 LANGUAGES CXX C)
33
include(CMakePackageConfigHelpers)
44
include(GNUInstallDirs)
55

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

910
cmake_policy(SET CMP0048 NEW) # project() command manages VERSION variables
10-
set(CMAKE_CXX_STANDARD 17)
11+
set(CMAKE_CXX_STANDARD 23)
12+
set(CMAKE_CXX_EXTENSIONS OFF)
13+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
14+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1115
set(MULTI_TERMINAL 1)
1216
CONFIGURE_FILE("src/config.h.cmake" "include/cdd/config.h")
1317

14-
if(CMAKE_TOOLCHAIN_FILE)
15-
get_filename_component(TARGET ${CMAKE_TOOLCHAIN_FILE} NAME_WLE)
16-
set(LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs-${TARGET}")
17-
else(CMAKE_TOOLCHAIN_FILE)
18-
set(LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs")
19-
endif(CMAKE_TOOLCHAIN_FILE)
20-
message(STATUS "Using libs in ${LIBS_DIR}")
18+
if (UCDD_WITH_TESTS)
19+
include(cmake/doctest.cmake)
20+
enable_testing()
21+
endif (UCDD_WITH_TESTS)
2122

22-
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${LIBS_DIR}")
23-
find_package(xxHash 0.8.0 REQUIRED COMPONENTS xxhash PATHS ${LIBS_DIR}/xxHash)
24-
find_package(UUtils 1.1.1 REQUIRED PATHS ${LIBS_DIR}/UUtils)
25-
find_package(UDBM 2.0.11 REQUIRED PATHS ${LIBS_DIR}/UDBM)
26-
27-
include_directories(
28-
PRIVATE
29-
# where the library itself will look for its internal headers
30-
${CMAKE_BINARY_DIR}/include
31-
PUBLIC
32-
# where top-level project will look for the library's public headers
33-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
34-
# where external projects will look for the library's public headers
35-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
36-
)
23+
include(cmake/xxhash.cmake)
24+
include(cmake/UUtils.cmake)
25+
include(cmake/UDBM.cmake)
3726

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

45-
if (ASAN)
46-
add_compile_options(-fno-omit-frame-pointer -fsanitize=address)
47-
add_link_options(-fno-omit-frame-pointer -fsanitize=address)
48-
message(STATUS "Using Address Sanitizer")
49-
endif(ASAN)
50-
5134
add_subdirectory("src")
5235

53-
if(TESTING)
54-
enable_testing()
36+
if (UCDD_WITH_TESTS)
5537
add_subdirectory("test")
56-
endif(TESTING)
38+
endif(UCDD_WITH_TESTS)
5739

58-
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/UCDDConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion)
40+
write_basic_package_version_file(${PROJECT_BINARY_DIR}/UCDDConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion)
5941

6042
install(DIRECTORY include DESTINATION .)
61-
install(TARGETS UCDD EXPORT UCDDConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
6243
install(EXPORT UCDDConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UCDD)
63-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/UCDDConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UCDD )
64-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cdd/config.h DESTINATION include/cdd/)
44+
install(FILES ${PROJECT_BINARY_DIR}/UCDDConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UCDD)
45+
install(FILES ${PROJECT_BINARY_DIR}/include/cdd/config.h DESTINATION include/cdd/)

0 commit comments

Comments
 (0)