From 950479bdee558ec2c8dfdbb9d6dacaf11b98ec26 Mon Sep 17 00:00:00 2001 From: Kris Kwiatkowski Date: Mon, 14 Jun 2021 21:16:14 +0100 Subject: [PATCH] adds fpic --- .github/workflows/main.yml | 16 ++++++++-------- CMakeLists.txt | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dcf2b1c..bbfc1f84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,7 @@ jobs: gcc-debug-build, clang-debug-build, clang-debug-asan-build, + clang-debug-msan-build, ] include: @@ -29,27 +30,26 @@ jobs: cc: gcc cxx: g++ flags: -DCMAKE_BUILD_TYPE=Release - - name: gcc-debug-build cc: gcc cxx: g++ flags: -DCMAKE_BUILD_TYPE=Debug - - name: clang-release-build cc: clang cxx: clang++ flags: -DCMAKE_BUILD_TYPE=Release - long_tests: 1 - - name: clang-debug-build cc: /usr/bin/clang cxx: /usr/bin/clang++ flags: -DCMAKE_BUILD_TYPE=Debug - - name: clang-debug-asan-build - cc: /usr/bin/clang - cxx: /usr/bin/clang++ - flags: -DCMAKE_BUILD_TYPE=Debug -DSANITIZERS=1 + cc: clang + cxx: clang++ + flags: -DCMAKE_BUILD_TYPE=Release -DADDRSAN=1 + - name: clang-debug-msan-build + cc: clang + cxx: clang++ + flags: -DCMAKE_BUILD_TYPE=Release -DMEMSAN=1 steps: - uses: actions/checkout@v1 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index e4735c22..9c2b09ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ include(FetchContent) set(CMAKE_CXX_STANDARD 20) set(CMAKE_C_STANDARD 99) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) enable_language(C) enable_language(CXX) @@ -35,6 +36,7 @@ FetchContent_Declare( FetchContent_Populate(gbench) add_subdirectory(3rd/gtest) +set(BUILD_PIC ON CACHE BOOL "") add_subdirectory(3rd/cpu_features) set(CMAKE_VERBOSE_MAKEFILE ON)