forked from pieter3d/simview
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for non vendored abseil and gtest, as required on some platforms,
fixes pieter3d#18
- Loading branch information
Showing
3 changed files
with
105 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
find_package(Git QUIET) | ||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") | ||
# Update submodules as needed | ||
option(GIT_SUBMODULE "Check submodules during build" ON) | ||
if(GIT_SUBMODULE) | ||
message(STATUS "Submodule update") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
|
||
if(NOT SIMVIEW_USE_HOST_ABSL OR (SIMVIEW_BUILD_TESTS AND NOT SIMVIEW_USE_HOST_GTEST)) | ||
find_package(Git QUIET) | ||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") | ||
# Update submodules as needed | ||
option(GIT_SUBMODULE "Check submodules during build" ON) | ||
if(GIT_SUBMODULE) | ||
message(STATUS "Submodule update") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
endif() | ||
endif() | ||
endif() | ||
endif() | ||
|
||
# Abseil can trigger this warning at current version. | ||
set(CMAKE_CXX_FLAGS "-Wno-maybe-uninitialized") | ||
if(NOT SIMVIEW_USE_HOST_ABSL) | ||
# Abseil can trigger this warning at current version. | ||
set(CMAKE_CXX_FLAGS "-Wno-maybe-uninitialized") | ||
|
||
# Add all expected submodules. | ||
set(ABSL_PROPAGATE_CXX_STD ON) | ||
add_subdirectory(abseil-cpp EXCLUDE_FROM_ALL) | ||
endif() | ||
|
||
if(NOT SIMVIEW_USE_HOST_GTEST) | ||
add_subdirectory(googletest EXCLUDE_FROM_ALL) | ||
endif() | ||
|
||
# Add all expected submodules. | ||
set(ABSL_PROPAGATE_CXX_STD ON) | ||
add_subdirectory(abseil-cpp EXCLUDE_FROM_ALL) | ||
add_subdirectory(googletest EXCLUDE_FROM_ALL) | ||
add_subdirectory(fst) |