-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fix shaders not copying to final build on macOS for non Xcode builds (2) #1908
Conversation
Note: cmake 3.28+ is strong recommanded in mac/ios/tvos, the new cmake feature EMBED_RESOURCES will auto sync all compiled shaders in to deploy target |
Hmm.. CI osx builds show up as green, but they have actually failed. |
Do you mean |
yes, I have never use non-xcode for apple platforms to build axmol yet. |
strange, why the patch cause glfw build error |
I think this is due to CMake 3.20 requirement and adding if(APPLE)
enable_language(C CXX OBJC OBJCXX)
else()
enable_language(C CXX)
endif() Pushed fix, lets see if this will fix it. |
Looks like everything is working now. |
What about add to https://github.com/axmolengine/axmol/blob/dev/cmake/Modules/AXConfigDefine.cmake#L214 instead adding to project cmake one by one? |
Describe your changes
I attempted to fix this in #1631, but it works only if the shaders were already built (since it scans the
runtime/axslc
dir for files), so you have to rerun CMake again to pick them up. This PR fixes that.How it works: when
ax_target_compile_shaders()
is called on an app or library target to compile the shaders, it setsAX_COMPILED_SHADERS
variable on the target. The variable contains a list of compiled shaders. Whenax_setup_app_config()
is called on the app target, it recursively iterates all targets being linked, extracts the list of all shaders from them, and adds them as resources.