Skip to content

Commit 155259e

Browse files
committed
CMake: Allow excluding git submodule depends
Not every build system can handle git submodules, so expose an option to exclude these dependencies from the build
1 parent a869a22 commit 155259e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3939
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
4040

4141
option(TESTING "Build tests" ON)
42+
option(BUILD_INTERNAL_DEPS "Build internal dependencies from git submodules" ON)
4243
option(CLANG_FORMAT "Enable clang-format target" ON)
4344
option(CLANG_TIDY "Enable clang-tidy checks during compilation" OFF)
4445
option(COVERAGE "Enable generation of coverage info" OFF)
@@ -101,19 +102,23 @@ if (CLANG_FORMAT)
101102
include(cmake/clang-format.cmake)
102103
endif ()
103104

104-
add_subdirectory(deps)
105+
if (BUILD_INTERNAL_DEPS)
106+
add_subdirectory(deps)
107+
endif()
105108

106109
include_directories(
107110
# project includes
108111
${PROJECT_SOURCE_DIR}/core
109112
)
110113

111-
include_directories(
112-
SYSTEM
113-
# system includes
114-
deps/outcome
115-
${TINY_CBOR_INCLUDE_DIRS}
116-
)
114+
if (BUILD_INTERNAL_DEPS)
115+
include_directories(
116+
SYSTEM
117+
# system includes
118+
deps/outcome
119+
${TINY_CBOR_INCLUDE_DIRS}
120+
)
121+
endif()
117122

118123
add_subdirectory(core)
119124

0 commit comments

Comments
 (0)