Skip to content

Commit

Permalink
Merge branch 'develop' into cairo_2023
Browse files Browse the repository at this point in the history
  • Loading branch information
djowel committed Oct 18, 2023
2 parents 7050ac9 + 47cb137 commit d5bd982
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
AccessModifierOffset: -3
IndentWidth: 3
...
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ if(CMAKE_CXX_STANDARD LESS 17)
set(CMAKE_CXX_STANDARD 17)
endif()

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
include(GitSubmoduleCheck)
git_submodule_check(lib/external/asio)
git_submodule_check(lib/infra)
endif()

include(ElementsConfigCommon)

option(ELEMENTS_BUILD_EXAMPLES "build Elements library examples" ON)
Expand Down
9 changes: 9 additions & 0 deletions cmake/GitSubmoduleCheck.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://gist.github.com/scivision/bb1d47a9529e153617414e91ff5390af
find_package(Git REQUIRED)
function(git_submodule_check dir)
if(NOT EXISTS "${dir}/CMakeLists.txt")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- ${dir}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY)
endif()
endfunction()

0 comments on commit d5bd982

Please sign in to comment.