Repository navigation
feat(linux): use native code's module maps and CMake builds - #6204
Merged
Merged
Conversation
A module.modulemap in src/ or include/ is passed to the generator as is; sources are built as the library its first `link` names. A CMakeLists.txt replaces the built-in compile: its shared libraries are bundled and the generator takes its flags from compile_commands.json.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Native code in
App_Resources/Linuxand plugins'platforms/linux, like iOS:module.modulemapinsrc/orinclude/goes to the metadata generator as is. Its headers, modules andlinklibraries are what JS gets. Sources are built as the library its firstlinknames (link "mason"→lib/libmason.so).CMakeLists.txtreplaces the built-in compile. Its shared libraries are bundled inlib/, and the generator takes include paths and defines fromcompile_commands.json. The build folder survives between builds, so CMake stays incremental.Without either, nothing changes:
src/*.c+src/*.hstill work with no config.Testing: 7 new tests in
test/services/linux-native-code.ts. End to end on Ubuntu 24.04 arm64 with real CMake and the generator: a CMake project with a module map, and a bare.c/.h, both called from JS throughns-linux.