-
Notifications
You must be signed in to change notification settings - Fork 72
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
empty resources in android project #2
Comments
CMRC uses a global table (unforuntate. I've thought about changing this approach) to store the resource file pointers. The There are a few potential problems, and I'd be curious to see what's gone wrong. My biggest hypothesis: There isn't a single global table that it is using. If the Might you be able to attach a debugger and break into the In the future, a better approach might involve not using a global table. |
I found the source of the error. Android Studio uses gradle scripts to compile an app. However these scripts don't output any messages from CMake (which is extremely annoying). So changing this line:
to
fixed it for me. |
Interesting... I'll keep this issue open so that I can go back and commit the fix, and also set |
It's been a while, but this should work now in older CMake versions. I've added a |
I'm currently writing a C++ app for android and accessing assets from native code is far from trivial in Android.
On my search for alternatives I stumbled upon your resource compiler. It looks fantastic and would solve a lot of problems for me. However when I try to access resources it just returns null pointers as iterators.
Have a look at the following:
Inside CMakeLists.txt:
Inside C++:
The code compiles without errors and prints two zeros when executed. However the vertex shader file definitely contains data.
In order to get behind this I added the following line to the cmake script:
This prints "infile: /home/<...>/ProjectPath/app/src/main/assets/shader/standard.vs" (and respectively "*.fs") which are the valid paths to my files I want to include. (Tested using "cat")
The table entries in "/home/<...>/ProjectPath/app/shaderFiles/lib_.cpp" are the following:
So I'm using the correct keys and the script uses the correct file paths. What could have gone wrong? How can I further investigate this problem? I'm not exactly a CMake expert...
The text was updated successfully, but these errors were encountered: