Closed StefanBruens closed 1 year ago
Forge (ArrayFire also) uses a specific workflow for fetching dependencies like glad, glm etc. for building the concerned project. I believe it is better to be consistent on how CMake fetches dependencies if possible, which it is in the case of glad for forge/arrayfire. I am not a fan of including large source files into the repository, especially when CMake can help with the same. Also, please note that, all this dependency handling is taken care by the CMakeLists.txt
without user invention. If that is not the case in your experience, please share the issue you have encountered.
forge should either include the pregenerated glad sources as a git subproject,
Sure, that is one way to do it. Again subtree is nothing but maintaining a copy of those sources in the downstream project which we want to avoid. We used to have similar dependencies as submodules, but we removed those in favor of CMake's fetch content which lets us handle the case of git
not being available in offline builds.
or use a plain upstream glad and configure it at build time.
In a way, what's transpiring now is akin to the above suggestion. The difference being, we keep the glad sources that arrayfire and forge needs in separate repository and we re-use that directly in our CMake.
As far as the offline builds are concerned, every release of forge uploads a full code base of forge that includes the dependencies also as forge-full-x.x.x.tar.bz2 GitHub release asset.
I am not suggesting the workflow of arrayfire/forge is the best route but it definitely addresses the uses cases we want to handle.
Closing due to inactivity, please re-open if required after reviewing my above response.
The "forge-full" tarball is broken - FetchContent_Populate
, as called by fg_dep_check_and_populate
requires a git checkout, i.e. including the ".git" directory.
Please try to build it without any network connection, it will fail with the following output:
[ 14s] [ 11%] Creating directories for 'fg_glad-populate'
[ 14s] [ 22%] Performing download step for 'fg_glad-populate'
[ 14s] [ 33%] Performing disconnected update step for 'fg_glad-populate'
[ 14s] CMake Error at /home/abuild/rpmbuild/BUILD/forge-1.0.8/build/extern/fg_glad-subbuild/fg_glad-populate-prefix/tmp/fg_glad-populate-gitupdate.cmake:34 (message):
[ 14s] Failed to get the hash for HEAD:
[ 14s]
[ 14s] fatal: not a git repository: '.git'
Current setup of glad dependency makes it unnecessary hard to build:
forge should either include the pregenerated glad sources as a git subproject, or use a plain upstream glad and configure it at build time.