Skip to content

Commit 44f241a

Browse files
committed
update & make boost submodule URL relative, update NBL_BOOST_GENERATE_DEP_LIST mini tool to autogen boost's .gitmodules
1 parent cc9f694 commit 44f241a

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
url = [email protected]:Devsh-Graphics-Programming/Nabla-Continous-Integration-Python-Framework.git
9191
[submodule "3rdparty/boost/superproject"]
9292
path = 3rdparty/boost/superproject
93-
url = [email protected]:boostorg/boost.git
93+
url = ../boost.git
9494
[submodule "3rdparty/argparse"]
9595
path = 3rdparty/argparse
9696
url = [email protected]:p-ranav/argparse.git

3rdparty/boost/CMakeLists.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ set(NBL_BOOST_TARGETS
4444
PARENT_SCOPE)
4545

4646
# Boost uses it's own tool for generating dependency list for targets, therefore we
47-
# can make sure manually added dependnecy subdirectories for a library are valid
47+
# can make sure manually added dependency subdirectories for a library are valid
4848
# https://www.boost.org/doc/libs/1_83_0/tools/boostdep/doc/html/index.html#boostdep.introduction.building_boostdep
4949

5050
if(NBL_BOOST_GENERATE_DEP_LIST) # internal, for Nabla devs
@@ -83,5 +83,29 @@ if(NBL_BOOST_GENERATE_DEP_LIST) # internal, for Nabla devs
8383
list(FILTER NBL_BOOST_LIBS EXCLUDE REGEX "(unknown)")
8484
string(REPLACE "~" "/" NBL_BOOST_LIBS "${NBL_BOOST_LIBS}")
8585

86+
# we override boost's .gitmodules to pick only those modules we really use (reported by boost's dep executable)
87+
# boost hosts now like 200 repositories, some of them are really big however atm we reference around 60
88+
set(BOOST_SUBMODULE_TEMPLATE
89+
[=[
90+
91+
[submodule "@NAME@"]
92+
path = libs/@NAME@
93+
94+
fetchRecurseSubmodules = on-demand
95+
branch = .
96+
]=]
97+
)
98+
99+
unset(BOOST_GITMODULES)
100+
foreach(NAME ${NBL_BOOST_LIBS})
101+
string(REPLACE "/" "_" FLATTEN_NAME "${NAME}")
102+
string(CONFIGURE "${BOOST_SUBMODULE_TEMPLATE}" TEMPLATE)
103+
string(APPEND BOOST_GITMODULES "${TEMPLATE}")
104+
endforeach()
105+
106+
# NOTE: this you commit to version control
86107
file(WRITE "${NBL_BOOST_WAVE_DEP_FILE}" "set(NBL_BOOST_LIBS ${NBL_BOOST_LIBS})")
108+
109+
# and this one too + you update boost submodule pointer with the update!
110+
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/superproject/.gitmodules" "${BOOST_GITMODULES}")
87111
endif()

3rdparty/boost/superproject

0 commit comments

Comments
 (0)