Skip to content

Commit 2a7ef7c

Browse files
committed
Don't force linker choice in test suite CMakeLists.txt
1 parent ca5f6d9 commit 2a7ef7c

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

.github/workflows/build-ubuntu.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
cxx:
32-
- g++-9
33-
- clang++-11
31+
build:
32+
- compiler: g++-9
33+
linker: GOLD
34+
- compiler: clang++-11
35+
linker: LLD
3436
config:
3537
# Release build
3638
- build_type: Release
@@ -44,11 +46,11 @@ jobs:
4446
- uses: actions/checkout@v4
4547

4648
- name: Install GCC
47-
if: ${{matrix.cxx == 'g++-9'}}
49+
if: ${{matrix.build.compiler == 'g++-9'}}
4850
run: sudo apt-get install -y g++-9
4951

5052
- name: Install Clang
51-
if: ${{matrix.cxx == 'clang++-11'}}
53+
if: ${{matrix.build.compiler == 'clang++-11'}}
5254
run: sudo apt-get install -y clang-11 lld-11
5355

5456
- name: Install Valgrind
@@ -58,15 +60,16 @@ jobs:
5860
- name: Configure CMake
5961
working-directory: ${{runner.workspace}}
6062
env:
61-
CXX: ${{matrix.cxx}}
63+
CXX: ${{matrix.build.compiler}}
6264
run: |
63-
cmake -H${{github.event.repository.name}} -Bbuild \
65+
cmake -S ${{github.event.repository.name}} -B build \
6466
-DCMAKE_CONFIGURATION_TYPES=${{matrix.config.build_type}} \
6567
-DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} \
68+
-DCMAKE_LINKER_TYPE=${{matrix.build.linker}} \
6669
-DCPPSORT_SANITIZE=${{matrix.config.sanitize}} \
6770
-DCPPSORT_USE_VALGRIND=${{matrix.config.valgrind}} \
68-
-G"Unix Makefiles" \
69-
-DCPPSORT_BUILD_EXAMPLES=ON
71+
-DCPPSORT_BUILD_EXAMPLES=ON \
72+
-G"Unix Makefiles"
7073
7174
- name: Build the test suite
7275
shell: bash

.github/workflows/code-coverage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ jobs:
3232
shell: bash
3333
working-directory: ${{runner.workspace}}
3434
run: >
35-
cmake -H${{github.event.repository.name}} -Bbuild
35+
cmake -S ${{github.event.repository.name}} -B build
3636
-DCMAKE_BUILD_TYPE=Debug
37+
-DCMAKE_LINKER_TYPE=GOLD
3738
-DCPPSORT_ENABLE_COVERAGE=ON
3839
-DGENINFO_EXTRA_FLAGS="--ignore-errors mismatch,mismatch"
3940
-DLCOV_EXTRA_FLAGS="--ignore-errors unused"

tests/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ macro(configure_tests target)
110110
$<$<AND:$<CONFIG:Debug>,$<CXX_COMPILER_ID:GNU>>:-Og>
111111
)
112112

113-
# Use lld or the gold linker if possible
114-
if (UNIX AND NOT APPLE)
115-
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
116-
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=lld")
117-
else()
118-
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=gold")
119-
endif()
120-
endif()
121-
122113
# Optionally enable sanitizers
123114
if (UNIX AND CPPSORT_SANITIZE)
124115
target_compile_options(${target} PRIVATE

0 commit comments

Comments
 (0)