Skip to content

Commit

Permalink
[CMake] Ship Google depot_tools with CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
ImmanuelHaffner committed May 4, 2024
1 parent 69724e3 commit 91432fe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeFiles/V8.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ ExternalProject_Add(
PREFIX third-party
DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8"
DOWNLOAD_COMMAND fetch --force v8 || true
DOWNLOAD_COMMAND env DEPOT_TOOLS_UPDATE=0 "${DEPOT_TOOLS_FETCH}" --force v8 || true
COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && git remote remove mutable || true
COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && git remote add mutable "https://gitlab.cs.uni-saarland.de/bigdata/mutable/v8.git" || true
COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && git fetch mutable
COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && git checkout adfc01872f43132c74bbd2182b127ad6f462f2c1
UPDATE_COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && gclient sync
COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && gclient sync -D -f
CONFIGURE_COMMAND gn gen out --root=${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8 --args=${V8_BUILD_ARGS}
UPDATE_COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && env DEPOT_TOOLS_UPDATE=0 "${DEPOT_TOOLS_GCLIENT}" sync
COMMAND cd "${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8/" && env DEPOT_TOOLS_UPDATE=0 "${DEPOT_TOOLS_GCLIENT}" sync -D -f
CONFIGURE_COMMAND "${DEPOT_TOOLS_GN}" gen out --root=${CMAKE_CURRENT_SOURCE_DIR}/third-party/v8/v8 --args=${V8_BUILD_ARGS}
CONFIGURE_HANDLED_BY_BUILD true
BUILD_BYPRODUCTS "${V8_BUILD_BYPRODUCTS}"
BUILD_COMMAND ninja -C out ${V8_LIBRARIES}
Expand Down
14 changes: 14 additions & 0 deletions CMakeFiles/depot_tools.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Google depot_tools
FetchContent_Populate(
Depot_tools
PREFIX third-party
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party"
GIT_REPOSITORY "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
GIT_TAG 530d86d40b2aab70e0541ea0f296388ec09f0576
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/depot_tools"
SYSTEM
EXCLUDE_FROM_ALL
)
find_program(DEPOT_TOOLS_FETCH fetch PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third-party/depot_tools" REQUIRED)
find_program(DEPOT_TOOLS_GCLIENT gclient PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third-party/depot_tools" REQUIRED)
find_program(DEPOT_TOOLS_GN gn PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third-party/depot_tools" REQUIRED)
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ set_source_files_properties(
include("CMakeFiles/Catch2.cmake")
include("CMakeFiles/Eigen.cmake")
include("CMakeFiles/nlohmann_json.cmake")
if (WITH_V8)
include("CMakeFiles/depot_tools.cmake")
endif()

# Include all required external projects.
include("CMakeFiles/Boost.cmake")
Expand Down

0 comments on commit 91432fe

Please sign in to comment.