External Dependencies¶
Methodology¶
As described in the hard requirements section of the Requirements page, the project uses the CPM package manager to install dependencies.
The package manager itself is more of a CMake module that is included in the project’s
/deps/CMakeLists.txt file, rather than a separate tool that needs to be installed on the
system. This makes setup much more practical as CPM can be fetched right from the internet without having to require
another hard requirement to be installed on the system.
Dependencies¶
Dependencies are declared subsequently in the /deps/CMakeLists.txt file.
The current contents of the file are as follows, and are subject to change as the project evolves.
include(get_cpm)
add_subdirectory(asio)
add_subdirectory(reflectcpp)
add_subdirectory(zlib)
add_subdirectory(sfml)
add_subdirectory(spdlog)
add_subdirectory(incbin)
add_subdirectory(luau)
Tip
When adding a new dependency, make sure to declare the GIT_TAG property to the CPMAddPackage function call to
ensure that we are using a specific version of the dependency.
This avoids having breaking changes during the development as new versions of said dependency are developed and published.
Troubleshooting Issues¶
CPM fails to clone submodules¶
If you are getting an output similar to the following, then git is failing to clone the submodules of the dependency.
[0/8] Performing download step (git clone) for 'reflect-cpp-populate'
Cloning into 'reflect-cpp-src'...
HEAD is now at 716de7b Emplace into optional to be able to visit variant containers containi… (#234)
Submodule 'vcpkg' (https://github.com/microsoft/vcpkg.git) registered for path 'vcpkg'
Cloning into '/home/alexis/Documents/Epitech/Projets/AdvancedCPP/BBOC/build/_deps/reflect-cpp-src/vcpkg'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 2514 bytes of body still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: premature end of file
fatal: fetch-pack: invalid index-pack output
fatal: cloning 'https://github.com/microsoft/vcpkg.git' into submodule path '/home/alexis/Documents/Epitech/Projets/AdvancedCPP/BBOC/build/_deps/reflect-cpp-src/vcpkg' failed
Unable to clone 'vcpkg'. Retrying
Cloning into '/home/alexis/Documents/Epitech/Projets/AdvancedCPP/BBOC/build/_deps/reflect-cpp-src/vcpkg'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 3057 bytes of body still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: premature end of file
fatal: fetch-pack: invalid index-pack output
fatal: cloning 'https://github.com/microsoft/vcpkg.git' into submodule path '/home/alexis/Documents/Epitech/Projets/AdvancedCPP/BBOC/build/_deps/reflect-cpp-src/vcpkg' failed
Unable to clone 'vcpkg' for the second time, giving up
CMake Error at reflect-cpp-subbuild/reflect-cpp-populate-prefix/tmp/reflect-cpp-populate-gitclone.cmake:75 (message):
Failed to update submodules in:
'/home/alexis/Documents/Epitech/Projets/AdvancedCPP/BBOC/build/_deps/reflect-cpp-src'
A workaround is to set the http.version option to HTTP/1.1 in the git configuration, as explained in this
StackOverflow topic.
Executing the following command should fix the issue, and allow git to clone the submodules correctly:
git config --global http.version HTTP/1.1