-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Builtin Resources CMake Refactor #477
Conversation
…/builtin/template/CAPKResourcesArchieve.h.in files, rewrite src/nbl/builtin/CMakeLists.txt and update src/nbl/CMakeLists.txt - save work. TODO: bring back python generation data
…ompiler Signed-off-by: Michael Pollind <mpollind@gmail.com>
Signed-off-by: Michael Pollind <mpollind@gmail.com>
…on scripts for builtin resources generation
…nbl/CMakeLists.txt with builtin python generation, update some source files, introduce Nabla internal NBL_BUILTIN_RESOURCES_DIRECTORY_PATH, add CArchive.h.in file
…bl/builtin/CMakeLists.txt. Update examples_tests submodule
…-builtin-linux-window
…iltin-linux-window bugfix: address build issues with embedded assets for clang and gnu compiler
…de of libraries we include in correspondingHeaderFile header
…re validation and fix bugs, set builtin resources library target CXX_STANDARD to 20
@AnastaZIuk can you fill out the PR description with a summary of our discord talk from 3 weeks ago? |
merge latest |
…had to change and it's no more dependency of Nabla - create proxy target and fix it. Force Nabla to use CMake 3.26
@AnastaZIuk When is this going to get merged? Do you need any help with this? resolving conflicts and whatnot |
we are waiting for @devshgraphicsprogramming approval, it's been ready |
…I haven't seen this on MSVC so far..
…esources auto-generated files and paths for proper archive creation. Update examples_tests submodule and perform tests. Add more docs
…ic const list directly in the CArchive.h
… as ext projects with Nabla
…ptional _SHARED_ argument in ADD_CUSTOM_BUILTIN_RESOURCES
…tion python scripts - make their sources be independent of Nabla's NBL_API2. Update builtin CMake utils
…ave it compiled with one single builtin resources library. Rename BR_API to NBL_BR_API. Move creation of nblBuiltinResourceData, have Nabla created first to be capable of using it's properties. Target source builtin files with PRIVATE qualifier to Nabla target. Perform tests
@AnastaZIuk after you merge #497 and answer #477 (comment) you can self-merge this PR |
Description
The PR introduces new way of handling built in resources thanks to
nbl::system::CFileArchive
. Built-in resources used to outputbuiltinResources.h
withget_resource()
declarationsbuiltinResourceData.cpp
withget_resource()
definitionsresources.txt
helper file for python built-in resources generation scripts with resource URI pathsIt were compiling to a static library, but Nabla namespaces were hardcoded and our CMake API could not let you abstract from Nabla. It has been changed.
Now multiple built-in resources can be created with custom namespace and they are handled by autogenerated
CArchive
class which inherits fromnbl::system::CFileArchive
. The class is defined in autogeneratedCArchive.h
next to old 3 autogenerated files.The template of the autogenerated
CArchive.h
file is here, it's basically overridingnbl::system::CFileArchive
's methods making it an archiver usingnbl::system::CNullAllocator
to obtain files.There are additional modifications the PR covers like
defines.h
Testing
Example 52. perform tests on built-in resources - it list a test text file as built-in resource, then it creates built-in resources library with custom namespace called
yourNamespace::builtin
and both Nabla and test built-in resources and then read at runtimeTODO list:
we were also talking about resource aliases and "turning some input into output and listing it as built-in resource" - however we have not discussed those in details so I have not covered them yet in the PR