Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JCash committed Oct 14, 2024
1 parent f51a653 commit 6d634b7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion server/src/main/java/com/defold/extender/Extender.java
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ private List<File> buildExtensionInternal_CSharp(File manifest, Map<String, Obje

Map<String, Object> context = createContext(manifestContext);

// Make sure the engine libraries isn't starting with "lib" (i.e. "libextension" -> "extension")
// Make sure the engine libraries aren't starting with "lib" (i.e. "libextension" -> "extension")
List<String> libs = (List<String>)context.get("engineLibs");
if (ExtenderUtil.isWindowsTarget(this.platform))
{
Expand Down
14 changes: 12 additions & 2 deletions server/src/main/java/com/defold/extender/ExtenderUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,18 @@ public static String switchExtension(String name, String newExt) {
public static boolean isAppleTarget(String platform) {
return platform.equals("arm64-osx") ||
platform.equals("x86_64-osx") ||
platform.equals("x86_64-ios") ||
platform.equals("arm64-ios");
platform.equals("arm64-ios") ||
platform.equals("x86_64-ios");
}

public static boolean isMacOSTarget(String platform) {
return platform.equals("arm64-osx") ||
platform.equals("x86_64-osx");
}

public static boolean isIOSTarget(String platform) {
return platform.equals("arm64-ios") ||
platform.equals("x86_64-ios");
}

public static boolean isWebTarget(String platform) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

Expand Down Expand Up @@ -127,22 +126,10 @@ private static String convertPlatform(String platform) {
return "unknown_platform";
}

private static boolean ismacOS(String platform) {
return platform.equals("arm64-osx") || platform.equals("x86_64-osx");
}

private static boolean isiOS(String platform) {
return platform.equals("arm64-ios") || platform.equals("x86_64-ios");
}

private static boolean isWindows(String platform) {
return platform.equals("x86-win32") || platform.equals("x86_64-win32");
}

private static String getLibName(String platform, String name) {
String prefix = "lib";
String suffix = ".a";
if (isWindows(platform))
if (ExtenderUtil.isWindowsTarget(platform))
{
prefix = "";
suffix = ".lib";
Expand All @@ -153,7 +140,7 @@ private static String getLibName(String platform, String name) {
private static String getObjName(String platform, String name) {
String prefix = "lib";
String suffix = ".o";
if (isWindows(platform))
if (ExtenderUtil.isWindowsTarget(platform))
{
prefix = "";
suffix = ".obj";
Expand Down Expand Up @@ -223,25 +210,25 @@ private static void addLibFlags(String platform, List<String> linkFlags) throws
paths.add(getLibName(platform, "standalonegc-enabled"));

String aotSuffix = "";
if (isWindows(platform))
if (ExtenderUtil.isWindowsTarget(platform))
aotSuffix = ".Aot";
paths.add(getLibName(platform, "System.IO.Compression.Native" + aotSuffix));
paths.add(getLibName(platform, "System.Globalization.Native" + aotSuffix));

if (ismacOS(platform))
if (ExtenderUtil.isMacOSTarget(platform))
{
paths.add(getLibName(platform, "System.Native"));
paths.add(getLibName(platform, "Runtime.VxsortEnabled"));
}
else if (isiOS(platform))
else if (ExtenderUtil.isIOSTarget(platform))
{
paths.add(getLibName(platform, "System.Native"));
paths.add(getLibName(platform, "stdc++compat"));
paths.add(getLibName(platform, "System.Net.Security.Native"));
paths.add(getLibName(platform, "System.Security.Cryptography.Native.Apple"));
linkFlags.add("-licucore");
}
else if (isWindows(platform))
else if (ExtenderUtil.isWindowsTarget(platform))
{
paths.add(getLibName(platform, "Runtime.VxsortEnabled"));
linkFlags.add("-lbcrypt");
Expand Down

0 comments on commit 6d634b7

Please sign in to comment.