Skip to content

Commit

Permalink
Fix output paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Aug 30, 2024
1 parent 1dd630e commit 969e060
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
21 changes: 13 additions & 8 deletions build/BuildLinuxTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,24 @@ public sealed class BuildLinuxTask : FrostingTask<BuildContext>

public override void Run(BuildContext context)
{
var buildWorkingDir = "openal-soft/";
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "-DALSOFT_TESTS=OFF -DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_INSTALL=OFF CMakeLists.txt" });
var buildWorkingDir = "openal-soft/build_linux";
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "-DALSOFT_TESTS=OFF -DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_INSTALL=OFF .." });
context.StartProcess("make", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "" });
context.CopyFile($"{buildWorkingDir}libopenal.so", $"{context.ArtifactsDir}/libopenal.so");
context.CopyFile($"{buildWorkingDir}libopenal.so", $"{context.ArtifactsDir}/linux-x64/libopenal.so");
BuildAndroid (context, "arm64-v8a", "android-arm64", "23");
BuildAndroid (context, "armeabi-v7a", "android-arm", "23");
BuildAndroid (context, "x86", "android-x86", "23");
BuildAndroid (context, "x86_64", "android-x64", "23");
}

void BuildAndroid (BuildContext context, string arch, string minNdk)
void BuildAndroid (BuildContext context, string arch, string rid, string minNdk)
{
//cmake -DANDROID_ABI={arch} -DANDROID_PLATFORM={minNdk} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DALSOFT_EMBED_HRTF_DATA=TRUE -DALSOFT_REQUIRE_OPENSL=ON -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=$ANDROID_NDK_HOME ..
var ndk = System.Environment.GetEnvironmentVariable ("ANDROID_NDK_HOME");
var buildWorkingDir = $"openal-soft/build_android_{arch}";
System.IO.Directory.CreateDirectory(buildWorkingDir);
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "-DANDROID_ABI={arch} -DANDROID_PLATFORM={minNdk} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DALSOFT_EMBED_HRTF_DATA=TRUE -DALSOFT_REQUIRE_OPENSL=ON -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=$ANDROID_NDK_HOME .." });
context.StartProcess("make", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "" });
context.CopyFile($"{buildWorkingDir}libopenal.so", $"{context.ArtifactsDir}/libopenal.so");
System.IO.Directory.CreateDirectory($"{context.ArtifactsDir}/{rid}");
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = $"-DANDROID_ABI={arch} -DANDROID_PLATFORM={minNdk} -DCMAKE_TOOLCHAIN_FILE={ndk}/build/cmake/android.toolchain.cmake -DALSOFT_EMBED_HRTF_DATA=TRUE -DALSOFT_REQUIRE_OPENSL=ON -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK={ndk} .." });
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "--build . --config Release" });
context.CopyFile($"{buildWorkingDir}/libopenal.so", $"{context.ArtifactsDir}/{rid}/libopenal.so");
}
}
10 changes: 5 additions & 5 deletions build/BuildMacOSTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public override void Run(BuildContext context)
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "-DCMAKE_OSX_ARCHITECTURES=\"x86_64;arm64\" -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_TESTS=OFF -DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_INSTALL=OFF -DCMAKE_BUILD_TYPE=Release .." });
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "--build . --config Release" });
var files = Directory.GetFiles(System.IO.Path.Combine(buildWorkingDir), "libopenal.*.*.*.dylib", SearchOption.TopDirectoryOnly);
context.CopyFile(files[0], $"{context.ArtifactsDir}/osx/libopenal.dylib");
BuildAndroid (context, "arm64-v8a", "android-arm64", "23");
BuildAndroid (context, "armeabi-v7a", "android-arm", "23");
BuildAndroid (context, "x86", "android-x86", "23");
BuildAndroid (context, "x86_64", "android-x64", "23");
context.CopyFile(files[0], $"{context.ArtifactsDir}/osx/libOpenAL32.dylib");
// BuildAndroid (context, "arm64-v8a", "android-arm64", "23");
// BuildAndroid (context, "armeabi-v7a", "android-arm", "23");
// BuildAndroid (context, "x86", "android-x86", "23");
// BuildAndroid (context, "x86_64", "android-x64", "23");
BuildiOS (context);
}

Expand Down
6 changes: 3 additions & 3 deletions build/BuildWindowsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public sealed class BuildWindowsTask : FrostingTask<BuildContext>

public override void Run(BuildContext context)
{
var buildWorkingDir = "openal-soft/";
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "-DALSOFT_TESTS=OFF -DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_INSTALL=OFF CMakeLists.txt" });
var buildWorkingDir = "openal-soft/build_windows";
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "-DALSOFT_TESTS=OFF -DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_INSTALL=OFF .." });
//context.ReplaceTextInFiles("assimp/code/assimp.vcxproj", "MultiThreadedDLL", "MultiThreaded");
//context.ReplaceTextInFiles("assimp/contrib/zlib/zlibstatic.vcxproj", "MultiThreadedDLL", "MultiThreaded");
context.StartProcess("cmake", new ProcessSettings { WorkingDirectory = buildWorkingDir, Arguments = "--build . --config release" });
context.CopyFile(@"assimp/bin/Release/assimp-vc143-mt.dll", $"{context.ArtifactsDir}/assimp.dll");
context.CopyFile(@"openal-soft/Release/OpenAL32.dll", $"{context.ArtifactsDir}/windows-x64/openal.dll");
}
}

0 comments on commit 969e060

Please sign in to comment.