Skip to content

Commit

Permalink
next one
Browse files Browse the repository at this point in the history
  • Loading branch information
robinholzi committed May 2, 2024
1 parent fbbea39 commit da2d44b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
schedule:
- cron: '0 0 1 * *' # Run at midnight on the first of every month
workflow_dispatch:
# pull_request:
# branches: main
pull_request:
branches: main

concurrency:
group: grpc-build
Expand Down Expand Up @@ -75,7 +75,8 @@ jobs:
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_FLAGS="-fdebug-prefix-map=${{github.workspace}}/build=."
-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' || ''}}"
-DgRPC_PROTOBUF_PROVIDER=module
-DABSL_ENABLE_INSTALL=On
-DgRPC_BUILD_CSHARP_EXT=Off
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=libstdc++ -std=c++20")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libstdc++ -lc++abi")
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")
endif()

if (${MODYN_TEST_COVERAGE})
Expand Down
7 changes: 4 additions & 3 deletions cmake/storage_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ endforeach()


################### gRPC ####################
set(MODYN_GRPC_CPP_PLUGIN "grpc_cpp_plugin") # default, without gRPC:: prefix
set(MODYN_USES_LOCAL_GRPC false)
if(MODYN_TRY_LOCAL_GRPC)
set(protobuf_MODULE_COMPATIBLE true)
Expand All @@ -82,9 +83,9 @@ if(MODYN_TRY_LOCAL_GRPC)
message(STATUS "Found protobuf!")
include_directories(${PROTOBUF_INCLUDE_DIRS})
set(MODYN_USES_LOCAL_GRPC true)
if (NOT TARGET grpc_cpp_plugin)
message(STATUS "Since grpc_cpp_plugin was not defined as a target, we define it manually.")
add_executable(grpc_cpp_plugin ALIAS gRPC::grpc_cpp_plugin)
set(MODYN_GRPC_CPP_PLUGIN "gRPC::grpc_cpp_plugin")
if (NOT TARGET gRPC::grpc_cpp_plugin)
message(FATAL "grpc_cpp_plugin was not defined as a target!")
endif()
else()
message(FATAL "Did not find Protobuf, please run cmake in a clean build directory with -DMODYN_TRY_LOCAL_GRPC=Off or install protobuf on your system.")
Expand Down
4 changes: 2 additions & 2 deletions modyn/storage/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protobuf_generate(
OUT_VAR PROTO_GENERATED_FILES
LANGUAGE grpc
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc
PLUGIN "protoc-gen-grpc=\$<TARGET_FILE:grpc_cpp_plugin>"
PLUGIN "protoc-gen-grpc=\$<TARGET_FILE:${MODYN_GRPC_CPP_PLUGIN}>"
# PLUGIN_OPTIONS "generate_mock_code=true"
IMPORT_DIRS ../../protos
PROTOC_OUT_DIR "${PROTO_BINARY_DIR}")
Expand Down Expand Up @@ -94,4 +94,4 @@ target_compile_definitions(modyn-storage-library PUBLIC ${MODYN_COMPILE_DEFINITI
set(INCLUDE_EXPR "$<TARGET_PROPERTY:modyn-storage-library,INCLUDE_DIRECTORIES>")
set(INCLUDE_FILTER "$<FILTER:${INCLUDE_EXPR},INCLUDE,.*/.*>")
set(INCLUDE_JOINED "$<JOIN:${INCLUDE_FILTER},,>")
target_compile_definitions(modyn-storage-library PRIVATE "INCLUDE_DIRECTORIES=\"${INCLUDE_JOINED}\"")
target_compile_definitions(modyn-storage-library PRIVATE "INCLUDE_DIRECTORIES=\"${INCLUDE_JOINED}\"")

0 comments on commit da2d44b

Please sign in to comment.