Skip to content

Commit

Permalink
force llvm std lib
Browse files Browse the repository at this point in the history
  • Loading branch information
robinholzi committed May 5, 2024
1 parent 843603d commit a22109d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .github/actions/environment_clang.yaml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/build_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
with:
environment-name: clang
cache-environment: true
create-args: ccache clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}}
create-args: clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}}
# gcc_linux-64=${{matrix.compiler.version}} gxx_linux-64=${{matrix.compiler.version}}

- name: Create build and artifact directories
Expand All @@ -60,16 +60,15 @@ jobs:
- name: Configure CMake
working-directory: ${{github.workspace}}/cmake/build
# fdebug-prefix-map is for ccache to not have absolute paths interfere with caching, see https://ccache.dev/manual/3.6.html#_compiling_in_different_directories
# -DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=."
# -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -lc++abi' || ''}}"
run: >
cmake
-G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=."
-DCMAKE_CXX_STANDARD_LIBRARIES="${{ matrix.compiler.cxx == 'clang++' && '-lc++ -lc++abi' || ''}}"
-DgRPC_PROTOBUF_PROVIDER=module
-DABSL_ENABLE_INSTALL=On
-DgRPC_INSTALL=ON
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ jobs:
- name: Install clang environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/actions/environment_clang.yaml
cache-environment: true
create-args: clang-18 clang-tools clang-format-18

Expand Down Expand Up @@ -208,19 +207,14 @@ jobs:
# gcc-12 causes a false-positive memory error in release (https://github.com/google/googletest/issues/4108)
- compiler: { c: gcc, cxx: g++, version: 12 }
build-type: Release
env:
CC: ${{matrix.compiler.c}}-${{matrix.compiler.version}}
CXX: ${{matrix.compiler.cxx}}-${{matrix.compiler.version}}
# CCACHE_BASEDIR: ${{github.workspace}}
steps:
- uses: actions/checkout@v4

- name: Install clang environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/actions/environment_clang.yaml
cache-environment: true
create-args: ccache clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}}
create-args: clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}}
# gcc_linux-64=${{matrix.compiler.version}} gxx_linux-64=${{matrix.compiler.version}}

- name: Setup pre-built grpc binaries
Expand All @@ -242,13 +236,16 @@ jobs:

- name: Configure CMake
working-directory: ${{github.workspace}}/build
# fdebug-prefix-map is for ccache to not have absolute paths interfere with caching, see https://ccache.dev/manual/3.6.html#_compiling_in_different_directories
# -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# -DCMAKE_CXX_FLAGS="-fdebug-prefix-map=${{github.workspace}}/build=."
run: >
cmake ${{github.workspace}}
-DCMAKE_PREFIX_PATH=${{github.workspace}}/install
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=."
-DCMAKE_CXX_STANDARD_LIBRARIES="${{ matrix.compiler.cxx == 'clang++' && '-lc++ -lc++abi' || ''}}"
-DMODYN_TRY_LOCAL_GRPC=ON
-DMODYN_BUILD_PLAYGROUND=ON
-DMODYN_BUILD_TESTS=ON
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND MODYN_COMPILE_OPTIONS "-Wshadow-all" "-Wno-shadow-field-in-constructor")

# Without this, we get compilation errors for the chrono header. We need to set this globally
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=stdlibc++ -lc++abi")
endif()

if (${MODYN_TEST_COVERAGE})
Expand Down

0 comments on commit a22109d

Please sign in to comment.