Skip to content

Commit 9eda5e2

Browse files
authored
Cleanup Build (#673)
* Pin swift version * Some build cleanup * Correctly find unittests even if the build-folder is not called "build" * Greater build variety in the CI * Minimize direct modification of CMAKE_CXX_FLAGS + use portable variants of some compilation flags if available + add the ability to turn on -march=native + minor * Add compile options only for C++ build + link LLVM publicly to support BUILD_SHARED_LIBS * Only add asan for CXX builds * Some build cleanup * Correctly find unittests even if the build-folder is not called "build" * Greater build variety in the CI * Minimize direct modification of CMAKE_CXX_FLAGS + use portable variants of some compilation flags if available + add the ability to turn on -march=native + minor * Add compile options only for C++ build + link LLVM publicly to support BUILD_SHARED_LIBS * Only add asan for CXX builds * Move config defines to config.h.in * Fix add_cxx_* macros + link more privately * Make PhasarClang optional * Install phasar-config.h * Out-factor DebugSan in PHASAR_ENABLE_SANITIZERS * Allow for multi-config (not tested) * Make dependencies independent from phasar build flags + enable more warnings * Support for manually setting USE_LLVM_FAT_LIB + remove some obsolete system dependencies * Cleanup system deps * Fix install boost in CI * Modernize LLVM build + minor improvements in bootstrap.sh * Improve add_phasar_library * Fix phasar_llvm lib build * Cleanup inclusion of OpenSSL- and Swift tests * minor * Remove explicit definition of linker language and lib prefix * Update install * Improve install by adding phasar include directories to the targets interfaces * minor * Small fixes for the in-tree build * minor style * minor tweak for in-tree build
1 parent de6d505 commit 9eda5e2

57 files changed

Lines changed: 744 additions & 1033 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Checks: '-*,
2525
-cppcoreguidelines-non-private-member-variables-in-classes,
2626
-cppcoreguidelines-init-variables,
2727
-cppcoreguidelines-macro-usage,
28+
-cppcoreguidelines-avoid-do-while,
2829
bugprone-*,
2930
-bugprone-easily-swappable-parameters,
3031
modernize-*,

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assignees: ''
1111
Replace the empty checkboxes [ ] below with checked ones [x] accordingly. -->
1212

1313
- [ ] I have searched open and closed issues for duplicates
14-
- [ ] I made sure that I am not using an old project version (DO: pull Phasar, update git submodules, rebuild the project and check if the bug is still there)
14+
- [ ] I made sure that I am not using an old project version (DO: pull PhASAR, update git submodules, rebuild the project and check if the bug is still there)
1515

1616
----------------------------------------
1717

@@ -24,9 +24,9 @@ Describe here the issue that you are experiencing.
2424
- that reproduce the bug
2525
- e.g. cli arguments and flags
2626

27-
**Actual result:** Describe here what happens after you run the steps above (i.e. the buggy behaviour)
27+
**Actual result:** Describe here what happens after you run the steps above (i.e. the buggy behavior)
2828

29-
**Expected result:** Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour)
29+
**Expected result:** Describe here what should happen after you run the steps above (i.e. what would be the correct behavior)
3030

3131
### Context (Environment)
3232

@@ -35,7 +35,7 @@ Describe here the issue that you are experiencing.
3535
- **phasar:** \[commit-id]
3636
- **googletest:** \[commit-id]
3737
- **json:** \[commit-id]
38-
- **WALi-OpenNWA:** \[commit-id]
38+
- **json-schema-validator** \[commit-id]
3939

4040
<!-- Which operating system are you using? -->
4141

@@ -48,11 +48,12 @@ Describe here the issue that you are experiencing.
4848

4949
**Build Type:**
5050
- [ ] cmake
51+
- [ ] bootstrap.sh
5152
- [ ] custom build
5253

5354
### Possible solution
5455

55-
We are happy to discuss possible solutions to this problem, especially if it origniates from a design flaw.
56+
We are happy to discuss possible solutions to this problem, especially if it originates from a design flaw.
5657

5758
### Example files
5859

.github/workflows/ci.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
matrix:
1515
compiler: [ [clang++-14, clang-14] ]
1616
build: [ Debug, Release ]
17+
include:
18+
- build: Debug
19+
flags: -DPHASAR_BUILD_DYNLIB=ON -DPHASAR_ENABLE_SANITIZERS=ON
20+
- build: Release
21+
flags: -DPHASAR_ENABLE_DYNAMIC_LOG=OFF
1722

1823
continue-on-error: false
1924
steps:
@@ -23,20 +28,11 @@ jobs:
2328
fetch-depth: 0
2429
submodules: recursive
2530

26-
- name: Install Basic Dependencies
27-
shell: bash
28-
run: |
29-
sudo apt-get update
30-
sudo apt-get -y install --no-install-recommends \
31-
cmake \
32-
ninja-build \
33-
libstdc++6 \
34-
libboost-all-dev
35-
3631
- name: Install Phasar Dependencies
3732
shell: bash
3833
run: |
3934
./utils/InstallAptDependencies.sh
35+
sudo apt-get -y install --no-install-recommends libboost-graph-dev
4036
4137
- name: Install Strategy Dependencies
4238
shell: bash
@@ -59,17 +55,17 @@ jobs:
5955
swift-version: "5.8.1"
6056
- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }}
6157
env:
62-
BUILD_TYPE: ${{ matrix.build }}
6358
CXX: ${{ matrix.compiler[0] }}
6459
CC: ${{ matrix.compiler[1] }}
6560
shell: bash
6661
run: |
6762
mkdir build
6863
cd build
6964
cmake .. \
70-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
71-
-DCMAKE_CXX_COMPILER=$CXX \
72-
-DBUILD_SWIFT_TESTS=1 \
65+
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
66+
-DBUILD_SWIFT_TESTS=ON \
67+
-DPHASAR_DEBUG_LIBDEPS=ON \
68+
${{ matrix.flags }} \
7369
-G Ninja
7470
cmake --build .
7571

BreakingChanges.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Development HEAD
44

55
- Default build mode is no longer `SHARED` but `STATIC`. To build in shared mode, use the cmake option `BUILD_SHARED_LIBS` which we don't recommend anymore. Consider using `PHASAR_BUILD_DYNLIB` instead to build one big libphasar.so.
6+
- Build type `DebugSan` has been removed in favor of a new CMake option `PHASAR_ENABLE_SANITIZERS` that not only works in `Debug` mode.
67

78
## v0323
89

0 commit comments

Comments
 (0)