Skip to content
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

checks for static lib #1278

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public abstract class AbstractTargetConfiguration implements TargetConfiguration

private static final List<String> baseNativeImageArguments = Arrays.asList(
"-Djdk.internal.lambda.eagerlyInitialize=false",
"-Ddebug.jdk.graal.jvmciConfigCheck=warn",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be defined somewhere else then? (globally?)

Copy link
Contributor Author

@jperedadnr jperedadnr Sep 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't have this before, and it is not needed now once gluonhq/graal#20 gets merged

"--no-server",
"-H:+SharedLibrary",
"-H:+AddAllCharsets",
Expand Down Expand Up @@ -190,16 +189,17 @@ public boolean compile() throws IOException, InterruptedException {

@Override
public boolean link() throws IOException, InterruptedException {
if (projectConfiguration.isStaticLibrary()) {
Logger.logSevere("Error: Don't call link to create a static lib");
return false;
}

compileAdditionalSources();

String appName = projectConfiguration.getAppName();
Path gvmPath = paths.getGvmPath();
Path objectFile = getProjectObjectFile();
List<String> linkerLibraryPathFlags = getLinkerLibraryPathFlags();

if (projectConfiguration.isStaticLibrary()) {
return true;
}
ProcessRunner linkRunner = new ProcessRunner(getLinker());

Path gvmAppPath = gvmPath.resolve(appName);
Expand All @@ -219,7 +219,7 @@ public boolean link() throws IOException, InterruptedException {
projectConfiguration.isUsePrismSW()));

linkRunner.addArgs(getTargetSpecificLinkOutputFlags());
linkRunner.addArgs(linkerLibraryPathFlags);
linkRunner.addArgs(getLinkerLibraryPathFlags());
linkRunner.addArgs(getNativeLibsLinkFlags());
linkRunner.addArgs(projectConfiguration.getLinkerArgs());
linkRunner.setInfo(true);
Expand Down Expand Up @@ -322,10 +322,10 @@ public boolean createStaticLib() throws IOException, InterruptedException {
Logger.logSevere("Error building a static library: error compiling the native image");
return false;
}
if (!link()) {
Logger.logSevere("Error building a static library: error linking the native image");
return false;
}

// make sure static Java/JavaFX libraries are available
getLinkerLibraryPaths();

ProcessRunner createStaticLibRunner = new ProcessRunner(getStaticArchiver());
createStaticLibRunner.addArg(getStaticArchiverArgs());
Path dest = paths.getGvmPath().resolve("lib" + projectConfiguration.getAppName() + ".a");
Expand Down
Loading