Skip to content

Commit

Permalink
Avoid static linking on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadKillingsworth committed Nov 16, 2022
1 parent 7c2ad70 commit 22631f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build-scripts/graal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ process.on('unhandledRejection', error => {
});

const NATIVE_IMAGE_BUILD_ARGS = [
'-H:+StaticExecutableWithDynamicLibC',
'-H:+ReportUnsupportedElementsAtRuntime',
'-H:IncludeResourceBundles=org.kohsuke.args4j.Messages',
'-H:IncludeResourceBundles=org.kohsuke.args4j.spi.Messages',
Expand All @@ -57,6 +56,11 @@ const NATIVE_IMAGE_BUILD_ARGS = [
path.resolve(process.cwd(), 'compiler.jar')
];

if (process.platform !== 'darwin') {
// MacOS does not support building statically linked images
NATIVE_IMAGE_BUILD_ARGS.unshift('-H:+StaticExecutableWithDynamicLibC');
}

runCommand(`native-image${process.platform === 'win32' ? '.cmd' : ''}`, NATIVE_IMAGE_BUILD_ARGS)
.catch(e => {
console.error(e);
Expand Down

0 comments on commit 22631f7

Please sign in to comment.