Skip to content

Commit

Permalink
repo: move duplicate google deps usage to file
Browse files Browse the repository at this point in the history
  • Loading branch information
haxscramper committed Mar 12, 2024
1 parent 96cd3b6 commit de7f752
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,11 @@ target_include_directories(lager_lib INTERFACE "${DEPS_DIR}/lager")

add_subdirectory("${DEPS_DIR}/pybind11")

add_subdirectory("${DEPS_DIR}/abseil-cpp")
add_subdirectory("${DEPS_DIR}/googletest")

include("${BASE}/src/hstd/wrappers/google_deps.cmake")
add_google_deps("${BASE}")

set(protobuf_INSTALL OFF)
set(protobuf_BUILD_TESTS OFF)
set(utf8_range_ENABLE_TESTS OFF)
set(utf8_range_ENABLE_INSTALL OFF)
add_subdirectory("${DEPS_DIR}/protobuf")
include("${DEPS_DIR}/protobuf/cmake/protobuf-generate.cmake")
add_subdirectory("${DEPS_DIR}/googletest")

set(JSON_BuildTests OFF CACHE INTERNAL "")

Expand Down
12 changes: 2 additions & 10 deletions scripts/cxx_codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ set(Clang_DIR "${TOOLCHAIN}/llvm/lib/cmake/clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")

set(DEPS_DIR "${BASE}/thirdparty")

add_subdirectory("${DEPS_DIR}/abseil-cpp" "${CMAKE_BINARY_DIR}/abseil_build")

set(protobuf_INSTALL OFF)
set(protobuf_BUILD_TESTS OFF)
set(utf8_range_ENABLE_TESTS OFF)
set(utf8_range_ENABLE_INSTALL OFF)

set(PROTOBUF_BINARY "${CMAKE_BINARY_DIR}/protobuf_build")
add_subdirectory("${DEPS_DIR}/protobuf" "${PROTOBUF_BINARY}")
include("${BASE}/src/hstd/wrappers/google_deps.cmake")
add_google_deps("${BASE}")
include("${DEPS_DIR}/protobuf/cmake/protobuf-generate.cmake")

set(LLVM_LIB_DIR "${TOOLCHAIN}/llvm/lib")
Expand Down
2 changes: 1 addition & 1 deletion scripts/cxx_repository/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ExternalProject_Add(libgit2
-DBUILD_SHARED_LIBS=OFF
-DBUILD_CLAR=OFF
-DBUILD_EXAMPLES=OFF
-DCMAKE_INSTALL_PREFIX="${LIBGIT2_PREFIX}"
-DCMAKE_INSTALL_PREFIX=${LIBGIT2_PREFIX}
)

add_dependencies(code_forensics libgit2)
Expand Down
12 changes: 12 additions & 0 deletions src/hstd/wrappers/google_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function(add_google_deps BASE)
set(DEPS_DIR "${BASE}/thirdparty")
add_subdirectory("${DEPS_DIR}/abseil-cpp" "${CMAKE_BINARY_DIR}/abseil_build")

set(protobuf_INSTALL OFF)
set(protobuf_BUILD_TESTS OFF)
set(utf8_range_ENABLE_TESTS OFF)
set(utf8_range_ENABLE_INSTALL OFF)

set(PROTOBUF_BINARY "${CMAKE_BINARY_DIR}/protobuf_build")
add_subdirectory("${DEPS_DIR}/protobuf" "${PROTOBUF_BINARY}")
endfunction()

0 comments on commit de7f752

Please sign in to comment.