Fix USE_SYSTEM_ONNXRUNTIME flag for Flatpak build #698
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the build configuration to enable the use of system-installed ONNX Runtime and pkg-config by default, and refines how these options are handled across different platforms. It also ensures that platform-specific logic for ONNX Runtime is clearer and more robust. The most important changes are grouped below.
Default build options:
USE_PKGCONFIGandUSE_SYSTEM_ONNXRUNTIMEare now set toONinCMakeLists.txt, meaning the build will prefer pkg-config and the system ONNX Runtime unless specified otherwise.Platform-specific ONNX Runtime handling:
CMakeLists.txtfor handlingUSE_SYSTEM_ONNXRUNTIMEis refactored:find_package, with appropriate include and link settings.onnxruntime::onnxruntime, but only adds the ONNX Runtime dylib as a source if not using the system runtime.USE_SYSTEM_ONNXRUNTIMEis enabled, as it is unsupported.USE_SYSTEM_ONNXRUNTIMEisOFF.Build presets and overrides:
CMakePresets.jsonfile is updated so that all provided presets explicitly setUSE_PKGCONFIGandUSE_SYSTEM_ONNXRUNTIMEtofalse, ensuring consistent behavior in CI and developer environments regardless of the new defaults. [1] [2] [3]Minor refactoring:
CMakeLists.txtare cleaned up to improve readability and maintainability.