Skip to content

Commit

Permalink
checks for static lib (#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Sep 9, 2024
1 parent 2851322 commit c3bf470
Showing 1 changed file with 10 additions and 10 deletions.
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",
"--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

0 comments on commit c3bf470

Please sign in to comment.