Skip to content

Commit

Permalink
Fixed macro not copying DLLs properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanicBTW committed May 29, 2024
1 parent ee35ee6 commit adfb4b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/webview/Macros.hx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package webview;

import haxe.macro.Compiler;
import sys.io.File;
import haxe.io.Path;
import sys.FileSystem;
import sys.io.File;
import haxe.macro.Expr;
import haxe.macro.Context;
import haxe.macro.Compiler;

using haxe.macro.PositionTools;

Expand All @@ -14,10 +14,14 @@ class Macros
// This macro will only run on Windows targets to copy over the EmbeddedBrowserWebView DLL
macro public static function copyDLLs():Array<Field>
{
var libDir:String = Path.directory(FileSystem.fullPath(Context.currentPos().getInfos().file)); // HxWebView/source/webview
libDir = Path.directory(libDir); // HxWebView/source
libDir = Path.directory(libDir); // HxWebView

Context.onAfterGenerate(() ->
{
var arch:String = #if HXCPP_M64 "x64" #else "x86" #end;
var dllsPath:String = Path.join([Sys.getCwd(), "internal", "windows", "EBWebView", arch]);
var dllsPath:String = Path.join([libDir, "internal", "windows", "EBWebView", arch]);
if (FileSystem.exists(dllsPath))
{
dllsPath = Path.join([dllsPath, "EmbeddedBrowserWebView.dll"]);
Expand Down

0 comments on commit adfb4b0

Please sign in to comment.