native
native copied to clipboard
Target-specific user defines?
User defines are typically used to control how a hook compiles native code. Sometimes, one might want to use different options depending on the target operating system or architecture. So it would potentially be helpful to have a unified system for OS or ABI-specific user defines, e.g.
# Expect sqlite3 to be linked statically, except on Android where we should load it.
hooks:
user_defines:
sqlite3:
source: executable
on_platform:
- os: android
user_defines:
source: system
Of course, hooks could implement a similar mechanism on their own. But given that this could come up frequently, maybe implementing it in hooks_runner would be a more elegant solution.
I believe this is a similar ask as:
- https://github.com/dart-lang/native/issues/2480
And another use case for the
Option 5: Pre-build-hook
which would enable scripting user-defines.