Skip to content

Commit

Permalink
build: Fix binding generation
Browse files Browse the repository at this point in the history
Fix cake script to respect current configuration when running
HaikuApiGenerator.
  • Loading branch information
trungnt2910 committed Jul 21, 2023
1 parent 4300ac3 commit d61507f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,17 @@ Task("GenerateBindings")

DotNetBuild($"generator/HaikuApiGenerator/HaikuApiGenerator.csproj", settings);

Environment.SetEnvironmentVariable("HAIKU_API_GENERATOR_OUTPUT_DIR", "out/generated");
Environment.SetEnvironmentVariable("LD_LIBRARY_PATH",
$"{Environment.GetEnvironmentVariable("LD_LIBRARY_PATH")}:{P.Combine(D.GetCurrentDirectory(), "external/CppSharp/bin/Release_x64")}");
DotNetRun($"generator/HaikuApiGenerator/HaikuApiGenerator.csproj");
var runSettings = new DotNetRunSettings
{
Configuration = configuration,
NoBuild = true,
};

runSettings.EnvironmentVariables.Add("HAIKU_API_GENERATOR_OUTPUT_DIR", "out/generated");
runSettings.EnvironmentVariables.Add("LD_LIBRARY_PATH",
$"{Environment.GetEnvironmentVariable("LD_LIBRARY_PATH")}:{P.Combine(D.GetCurrentDirectory(), $"external/CppSharp/bin/{configuration}_x64")}");

DotNetRun($"generator/HaikuApiGenerator/HaikuApiGenerator.csproj", runSettings);
});

Task("BuildCoreLibraries")
Expand Down

0 comments on commit d61507f

Please sign in to comment.