Skip to content

Commit

Permalink
Reactivate builds, other cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Aug 10, 2024
1 parent b53487f commit 2c2ec89
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 47 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,10 @@ jobs:
$ENV:CESIUM_VCPKG_RELEASE_ONLY="TRUE"
# Clear ANDROID_NDK_ROOT so that we use Unity's version
Remove-Item Env:ANDROID_NDK_ROOT
# Explicitly set the ezvcpkg path. Otherwise it will be `/.ezvcpkg` and the drive letter is ambiguous.
$ENV:EZVCPKG_BASEDIR="D:/.ezvcpkg"
# Run the build
dotnet run --project Build~
dir /.ezvcpkg/2024.07.12/installed/arm64-android-unity/include
dir /.ezvcpkg/2024.07.12/installed/arm64-android-unity/include/spdlog
# cat D:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity\native~\build-WSA-x86_64\build.log
# cat D:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity\native~\build-WSA-arm64\build.log
cat D:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity\native~\build-Android-arm64\build.log
# dir d:\cesium\CesiumForUnityBuildProject
# dir C:\.ezvcpkg\2024.07.12\packages\spdlog_arm64-android-unity
# dir C:\.ezvcpkg\2024.07.12\packages\spdlog_arm64-android-unity\include
# dir C:\.ezvcpkg\2024.07.12\packages\spdlog_arm64-android-unity\include\spdlog
- name: Publish package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v4
Expand Down
74 changes: 39 additions & 35 deletions Build~/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,41 +145,45 @@ public void Run()
if (OperatingSystem.IsWindows())
{
// TODO: we're currently only building for UWP on Windows. This should be an option, or a separate build command.
// Console.WriteLine("**** Compiling for Universal Windows Platform Player");
// unity.Run(new[]
// {
// "-batchmode",
// "-nographics",
// "-projectPath",
// Utility.ProjectRoot,
// "-buildTarget",
// "WindowsStoreApps",
// "-executeMethod",
// "CesiumForUnity.BuildCesiumForUnity.CompileForUWPAndExit"
// });

// Console.WriteLine("**** Adding generated files (for the UWP Player) to the package");
// AddGeneratedFiles("!UNITY_EDITOR && UNITY_WSA", generatedRuntimePath, Path.Combine(outputPackagePath, "Runtime", "generated"));

// Console.WriteLine("**** Compiling for Windows Player");
// unity.Run(new[]
// {
// "-batchmode",
// "-nographics",
// "-projectPath",
// Utility.ProjectRoot,
// "-buildTarget",
// "Win64",
// "-executeMethod",
// "CesiumForUnity.BuildCesiumForUnity.CompileForWindowsAndExit"
// });

// Console.WriteLine("**** Adding generated files (for the Windows Player) to the package");
// AddGeneratedFiles("!UNITY_EDITOR && UNITY_STANDALONE_WIN", generatedRuntimePath, Path.Combine(outputPackagePath, "Runtime", "generated"));

// // Clean the generated code directory.
// Directory.Delete(generatedRuntimePath, true);
// Directory.CreateDirectory(generatedRuntimePath);
Console.WriteLine("**** Compiling for Universal Windows Platform Player");
unity.Run(new[]
{
"-batchmode",
"-nographics",
"-projectPath",
Utility.ProjectRoot,
"-buildTarget",
"WindowsStoreApps",
"-executeMethod",
"CesiumForUnity.BuildCesiumForUnity.CompileForUWPAndExit"
});

Console.WriteLine("**** Adding generated files (for the UWP Player) to the package");
AddGeneratedFiles("!UNITY_EDITOR && UNITY_WSA", generatedRuntimePath, Path.Combine(outputPackagePath, "Runtime", "generated"));

// Clean the generated code directory.
Directory.Delete(generatedRuntimePath, true);
Directory.CreateDirectory(generatedRuntimePath);

Console.WriteLine("**** Compiling for Windows Player");
unity.Run(new[]
{
"-batchmode",
"-nographics",
"-projectPath",
Utility.ProjectRoot,
"-buildTarget",
"Win64",
"-executeMethod",
"CesiumForUnity.BuildCesiumForUnity.CompileForWindowsAndExit"
});

Console.WriteLine("**** Adding generated files (for the Windows Player) to the package");
AddGeneratedFiles("!UNITY_EDITOR && UNITY_STANDALONE_WIN", generatedRuntimePath, Path.Combine(outputPackagePath, "Runtime", "generated"));

// Clean the generated code directory.
Directory.Delete(generatedRuntimePath, true);
Directory.CreateDirectory(generatedRuntimePath);

// TODO: we're currently only building for Android on Windows. This should be an option, or a separate build command.
Console.WriteLine("**** Compiling for Android Player");
Expand Down
4 changes: 1 addition & 3 deletions Editor/CompileCesiumForUnityNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ internal static void BuildNativeLibrary(LibraryToBuild library)

List<string> args = new List<string>()
{
"--trace-expand",
"-B",
library.BuildDirectory,
"-S",
Expand Down Expand Up @@ -490,8 +489,7 @@ internal static void BuildNativeLibrary(LibraryToBuild library)
"--parallel",
(Environment.ProcessorCount + 1).ToString(),
"--target",
"install",
"--verbose"
"install"
};
args.AddRange(library.ExtraBuildArgs);
startInfo.Arguments = string.Join(' ', args);
Expand Down

0 comments on commit 2c2ec89

Please sign in to comment.