Cmake use FetchContent for compression libraries - #3151
Conversation
|
@johnzupin @richard-lunarg @KarenGhavam-lunarG This would change GFXR's compression library policy from "it's whatever binary we checked in" to "build from pinned source revision by default". Notably downstream distro packaging may balk at not using the system libraries, but this shouldn't be any worse than before, just requires Take a moment please to consider if this affects the SDK build or packaging in downstream distros. |
|
Having worked with packagers before, I think they would be fine as long as they have a switch to disable included libraries and use system ones instead. I (and I assume package maintainers) would prefer that it tries to use system libraries first and only falls back to fetching its own library sources, as then it tries to do the arguably correct thing first and (possibly significantly) reduces initial compile time. |
|
CI testing of a version change should catch interface changes at compile time, and hopefully cover any behavioral changes as well. |
|
This means ci jobs can be updated, dropping lines like |
…mpression # Conflicts: # .github/workflows/scripts/build-dependencies-macos.sh
|
Was under the assumption that we would get this approved before a subsequent PR with the |
|
This does affect SDK builds for Windows ARM. These packages last I checked did not support building a combined binary (Intel/ARM), so I have to build both sets and combine them. I then checked them into the repository for ARM builds. Whenever we update the version, I either need to leave it as is, or do a manual build to update them. |
charles-lunarg
left a comment
There was a problem hiding this comment.
Its a good start - just needs some cleanup work to remove the code and documentation that became stale with the changes.
There was a problem hiding this comment.
Noticed something in the top level CMakeLists.txt - we add the precompiled libraries to CMAKE_PREFIX_PATH, but we are deleting those libraries (except for windows, which still has some). Meaning, we can delete those calls to set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ...)
I think there are only three places which need removal, linked here.
Line 307 in 6cccab6
Line 311 in 6cccab6
Line 319 in 6cccab6
Other than that I think its good to go.
Note that we likely will need to amend building to allow using system libraries instead of fetch content. This could be as simple as a build option, like GFXRECON_COMPRESSION_FROM_SYSTEM or a similar name, that just uses find_package().
E.G
if (GFXRECON_COMPRESSION_FROM_SYSTEM)
find_package(LZ4 REQUIRED)
return()
endif()
<rest of the FindLZ4.cmake file>
Build GFXR's compression libraries from source rather than precompiled binaries.