Skip to content

Commit

Permalink
Move native DLL directory to 'lib'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Apr 11, 2019
1 parent b788376 commit 20f626d
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Export/
ndll/*/lime*
ndll/*/liblime*
lib/*/lime*
lib/*/liblime*
project/all_objs
project/obj
project/vc*.pdb
Expand Down
Empty file removed ndll/Linux/.gitignore
Empty file.
Empty file removed ndll/Linux64/.gitignore
Empty file.
Empty file removed ndll/Mac/.gitignore
Empty file.
Empty file removed ndll/Mac64/.gitignore
Empty file.
Empty file removed ndll/Windows/.gitignore
Empty file.
6 changes: 3 additions & 3 deletions project/Build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<set name="LIME_WEBM" value="1" /> -->
<set name="LIME_ZLIB" value="1" />

<set name="OUTPUT_DIR" value="../ndll" unless="OUTPUT_DIR" />
<set name="OUTPUT_DIR" value="../lib" unless="OUTPUT_DIR" />
<set name="NATIVE_TOOLKIT_PATH" value="lib" unless="NATIVE_TOOLKIT_PATH" />

<set name="NATIVE_TOOLKIT_HAVE_CAIRO" value="1" if="LIME_CAIRO" />
Expand Down Expand Up @@ -390,7 +390,7 @@
<ext value=".so" />
<ext value=".ndll" if="windows || mac || linux" />

<!-- TODO: Support single binary -->
<!-- TODO: Support single binary? -->
<ext value=".hdll" if="LIME_HASHLINK" />

<section if="windows">
Expand Down Expand Up @@ -467,7 +467,7 @@

<section if="android">

<lib name="-L../ndll/Android" />
<lib name="-L../lib/Android" />

<lib name="-ldl" />
<lib name="-llog" />
Expand Down
Binary file modified run.n
Binary file not shown.
4 changes: 2 additions & 2 deletions src/lime/system/CFFI.hx
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ class CFFI

if (haxelib != "")
{
result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + slash + library, library, method, args);
result = __tryLoad(haxelib + slash + "lib" + slash + __sysName() + slash + library, library, method, args);

if (result == null)
{
result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + "64" + slash + library, library, method, args);
result = __tryLoad(haxelib + slash + "lib" + slash + __sysName() + "64" + slash + library, library, method, args);
}
}
}
Expand Down
Binary file modified svg.n
Binary file not shown.
31 changes: 16 additions & 15 deletions templates/extension/project/Build.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
<xml>

<include name="${HXCPP}/build-tool/BuildCommon.xml"/>

<files id="common">

<compilerflag value="-Iinclude"/>

<file name="common/ExternalInterface.cpp"/>
<file name="common/::file::.cpp"/>

</files>

<set name="SLIBEXT" value=".lib" if="windows"/>
<set name="SLIBEXT" value=".a" unless="windows"/>
<set name="SLIBEXT" value=".so" if="webos"/>

<set name="DEBUGEXTRA" value="-debug" if="fulldebug" />

<target id="NDLL" output="${LIBPREFIX}::extensionLowerCase::${MSVC_LIB_VERSION}${DEBUGEXTRA}${LIBEXTRA}" tool="linker" toolid="${STD_MODULE_LINK}">
<outdir name="../ndll/${BINDIR}"/>

<outdir name="../lib/${BINDIR}"/>
<ext value=".ndll" if="windows || mac || linux"/>
<ext value=".hdll" if="hashlink"/>
<files id="common"/>

</target>

<target id="default">

<target id="NDLL"/>

</target>

</xml>
20 changes: 16 additions & 4 deletions tools/CommandLineTools.hx
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,11 @@ class CommandLineTools

if (FileSystem.exists("tools.n"))
{
path = Path.combine(Sys.getCwd(), "../ndll/");
path = Path.combine(Sys.getCwd(), "../lib/");
}
else if (FileSystem.exists("run.n"))
{
path = Sys.getCwd() + "/ndll/";
path = Sys.getCwd() + "/lib/";
}

if (path == "")
Expand All @@ -452,9 +452,21 @@ class CommandLineTools
{
var line = StringTools.trim(process.stdout.readLine());

if (StringTools.startsWith(line, "-L "))
if (line.length > 0 && !StringTools.startsWith(line, "-"))
{
path = StringTools.trim(line.substr(2));
path = StringTools.trim(line);
if (FileSystem.exists(Path.combine(path, "../lib")))
{
path = Path.combine(path, "../lib");
}
else
{
path = Path.combine(path, "../ndll");
}
if (!StringTools.endsWith(path, "/"))
{
path += "/";
}
break;
}
}
Expand Down
21 changes: 1 addition & 20 deletions tools/RunScript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,15 @@ class RunScript
toolsDirectory = Path.combine(limeDirectory, "../tools");
}

/*var extendedToolsDirectory = Haxelib.getPath (new Haxelib ("lime-extended"), false);
if (extendedToolsDirectory != null && extendedToolsDirectory != "") {
var buildScript = File.getContent (Path.combine (extendedToolsDirectory, "tools.hxml"));
buildScript = StringTools.replace (buildScript, "\r\n", "\n");
buildScript = StringTools.replace (buildScript, "\n", " ");
System.runCommand (toolsDirectory, "haxe", buildScript.split (" "));
} else {*/

System.runCommand(toolsDirectory, "haxe", ["tools.hxml"]);

// }

if (!rebuildBinaries) return;

var platforms = ["Windows", "Mac", "Mac64", "Linux", "Linux64"];

for (platform in platforms)
{
var source = Path.combine(limeDirectory, "ndll/" + platform + "/lime.ndll");
// var target = Path.combine (toolsDirectory, "ndll/" + platform + "/lime.ndll");
var source = Path.combine(limeDirectory, "lib/" + platform + "/lime.ndll");

if (!FileSystem.exists(source))
{
Expand Down Expand Up @@ -91,10 +76,6 @@ class RunScript
Log.warn("", "Source path \"" + source + "\" does not exist");
}
}
else
{
// System.copyIfNewer (source, target);
}
}
}

Expand Down
18 changes: 15 additions & 3 deletions tools/SVGExport.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SVGExport

if (FileSystem.exists("svg.n"))
{
path = Path.combine(Sys.getCwd(), "../ndll/");
path = Path.combine(Sys.getCwd(), "../lib/");
}

if (path == "")
Expand All @@ -37,9 +37,21 @@ class SVGExport
{
var line = StringTools.trim(process.stdout.readLine());

if (StringTools.startsWith(line, "-L "))
if (line.length > 0 && !StringTools.startsWith(line, "-"))
{
path = StringTools.trim(line.substr(2));
path = StringTools.trim(line);
if (FileSystem.exists(Path.combine(path, "../lib")))
{
path = Path.combine(path, "../lib");
}
else
{
path = Path.combine(path, "../ndll");
}
if (!StringTools.endsWith(path, "/"))
{
path += "/";
}
break;
}
}
Expand Down
10 changes: 0 additions & 10 deletions tools/utils/CreateTemplate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ class CreateTemplate
FileSystem.rename(title + "/dependencies/android/src/main/java/org/haxe/extension/Extension.java",
title + "/dependencies/android/src/main/java/org/haxe/extension/" + file + ".java");
}

if (FileSystem.exists(title))
{
System.mkdir(title + "/ndll");
System.mkdir(title + "/ndll/Linux");
System.mkdir(title + "/ndll/Linux64");
System.mkdir(title + "/ndll/Mac");
System.mkdir(title + "/ndll/Mac64");
System.mkdir(title + "/ndll/Windows");
}
}

public static function createProject(words:Array<String>, userDefines:Map<String, Dynamic>, overrides:HXProject):Void
Expand Down

0 comments on commit 20f626d

Please sign in to comment.