Skip to content

Commit

Permalink
fixes for staticlib
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr committed Sep 5, 2024
1 parent fb547dd commit 489d6a0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public boolean link() throws IOException, InterruptedException {
String appName = projectConfiguration.getAppName();
Path gvmPath = paths.getGvmPath();
Path objectFile = getProjectObjectFile();
List<String> linkerLibraryPathFlags = getLinkerLibraryPathFlags();

if (projectConfiguration.isStaticLibrary()) {
return true;
Expand All @@ -218,7 +219,7 @@ public boolean link() throws IOException, InterruptedException {
projectConfiguration.isUsePrismSW()));

linkRunner.addArgs(getTargetSpecificLinkOutputFlags());
linkRunner.addArgs(getLinkerLibraryPathFlags());
linkRunner.addArgs(linkerLibraryPathFlags);
linkRunner.addArgs(getNativeLibsLinkFlags());
linkRunner.addArgs(projectConfiguration.getLinkerArgs());
linkRunner.setInfo(true);
Expand Down Expand Up @@ -330,7 +331,6 @@ public boolean createStaticLib() throws IOException, InterruptedException {
Path dest = paths.getGvmPath().resolve("lib" + projectConfiguration.getAppName() + ".a");
createStaticLibRunner.addArg(dest.toString());
createStaticLibRunner.addArg(getProjectObjectFile().toString());
createStaticLibRunner.addArgs(getAdditionalObjectFiles());
createStaticLibRunner.setInfo(true);
createStaticLibRunner.setLogToFile(true);
int result = createStaticLibRunner.runProcess("archive");
Expand All @@ -351,7 +351,7 @@ protected boolean compileAdditionalSources()
Path workDir = paths.getGvmPath().resolve(appName);
Files.createDirectories(workDir);

if (getAdditionalSourceFiles().isEmpty()) {
if (projectConfiguration.isStaticLibrary() || getAdditionalSourceFiles().isEmpty()) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public String getAdditionalSourceFileLocation() {
@Override
List<String> getAdditionalSourceFiles() {
List<String> answer = new ArrayList<>(androidAdditionalDummySourceFiles);
if (!projectConfiguration.isSharedLibrary() && !projectConfiguration.isStaticLibrary()) {
if (!projectConfiguration.isSharedLibrary()) {
answer.addAll(androidAdditionalSourceFiles);
if (projectConfiguration.hasWeb()) {
answer.addAll(androidAdditionalWebSourceFiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public String getAdditionalSourceFileLocation() {
@Override
List<String> getAdditionalSourceFiles() {
List<String> answer = new ArrayList<>(iosAdditionalDummySourceFiles);
if (!projectConfiguration.isSharedLibrary() && !projectConfiguration.isStaticLibrary()) {
if (!projectConfiguration.isSharedLibrary()) {
answer.addAll(iosAdditionalSourceFiles);
}
return answer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ List<String> getOtherStaticLibs() {

@Override
List<String> getAdditionalSourceFiles() {
if (projectConfiguration.isSharedLibrary() || projectConfiguration.isStaticLibrary()) {
if (projectConfiguration.isSharedLibrary()) {
return List.of();
}
return super.getAdditionalSourceFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ String getAdditionalSourceFileLocation() {

@Override
List<String> getAdditionalSourceFiles() {
if (projectConfiguration.isSharedLibrary() || projectConfiguration.isStaticLibrary()) {
if (projectConfiguration.isSharedLibrary()) {
return List.of();
}
return Arrays.asList("AppDelegate.m", "launcher.c");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private boolean executableOnPath(String executable) {

@Override
List<String> getAdditionalSourceFiles() {
if (projectConfiguration.isSharedLibrary() || projectConfiguration.isStaticLibrary()) {
if (projectConfiguration.isSharedLibrary()) {
return List.of();
}
return super.getAdditionalSourceFiles();
Expand Down

0 comments on commit 489d6a0

Please sign in to comment.