diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index f9f8630b..5a341967 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,15 +8,31 @@ on: jobs: update-goldens: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - name: Setup LLVM + uses: KyleMayes/install-llvm-action@v1 + with: + version: "16" + - name: Add LLVM to PATH + run: | + echo "${{ github.workspace }}/llvm/bin" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib/x86_64-unknown-linux-gnu/" >> $GITHUB_ENV + - name: Verify installation + run: clang --version + - name: Install Vulkan SDK and dependencies + run: | + wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list + sudo apt-get update + sudo apt-get install -y vulkan-sdk - name: Set up Flutter uses: subosito/flutter-action@v2 with: channel: master architecture: X64 - - run: cd thermion_dart && dart pub get && dart --enable-experiment=native-assets test + - run: cd thermion_dart && dart pub get && dart --enable-experiment=native-assets test test/asset_tests.dart - name: Zip goldens run: zip -r goldens.zip ./thermion_dart/test/output - name: Upload golden images @@ -24,6 +40,15 @@ jobs: with: name: golden-images-${{ github.sha }} path: goldens.zip + - name: Upload logs + if: failure() || steps.build.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + name: build-logs + path: | + ${{ github.workspace }}/thermion_dart/.dart_tool/thermion_dart/log/build.log + retention-days: 5 + flutter_examples: name: flutter_examples runs-on: macos-latest diff --git a/thermion_dart/hook/build.dart b/thermion_dart/hook/build.dart index 1fdaa311..236b4564 100644 --- a/thermion_dart/hook/build.dart +++ b/thermion_dart/hook/build.dart @@ -76,11 +76,9 @@ void main(List args) async { "filament", "backend", "filameshio", - "viewer", if (targetOS != OS.iOS) "filamat", - "meshoptimizer", - "mikktspace", - "geometry", + if (targetOS == OS.linux) "shaders", + //"geometry", "utils", "filabridge", "gltfio_core", @@ -97,22 +95,20 @@ void main(List args) async { "stb", "uberzlib", "smol-v", + "basis_transcoder", "uberarchive", "zstd", - "basis_transcoder", + "mikktspace", + "geometry", if (targetOS == OS.macOS) ...["matdbg", "fgviewer"] ]; - if (platform == "windows") { + if (targetOS == OS.windows) { // we just need the libDir and don't need to explicitly link the actual libs // (these are linked via ThermionWin32.h) libDir = Directory(libDir).uri.toFilePath(windows: targetOS == OS.windows); - } else { - libs.add("stdc++"); - } - - final flags = []; //"-fsanitize=address"]; + } final defines = {}; logger.info("User defines : ${input.userDefines}"); @@ -121,7 +117,10 @@ void main(List args) async { defines["ENABLE_TRACING"] = "1"; } + final flags = [ ]; //"-fsanitize=address"]; + var frameworks = []; + if (platform != "windows") { flags.addAll(['-std=c++17']); } else { @@ -170,6 +169,8 @@ void main(List args) async { libs.addAll(["bluegl", "bluevk"]); } else if (platform == "android") { libs.addAll(["GLESv3", "EGL", "bluevk", "dl", "android"]); + } else if (targetOS == OS.linux) { + libs.addAll(["bluevk","bluegl"]); } frameworks = frameworks.expand((f) => ["-framework", f]).toList(); @@ -189,12 +190,18 @@ void main(List args) async { : ['native/include', 'native/include/filament'], defines: platform == "windows" ? {} : defines, flags: [ - if (targetOS == OS.macOS) ...['-mmacosx-version-min=13.0'], + if (targetOS == OS.macOS) '-mmacosx-version-min=13.0', if (targetOS == OS.iOS) '-mios-version-min=13.0', ...flags, ...frameworks, - if (platform != "windows") ...[ - ...libs.map((lib) => "-l$lib"), + if(targetOS == OS.linux) + ...[ "-stdlib=libc++", "-Wl,--whole-archive" ], + if (targetOS != OS.windows)...[ + ...libs.map((lib) => "-l$lib"), + if(targetOS == OS.linux) + "-Wl,--no-whole-archive", + if(targetOS != OS.linux) + "-lstdc++", "-L$libDir" ], if (platform == "windows") ...[ diff --git a/thermion_dart/native/src/c_api/TTexture.cpp b/thermion_dart/native/src/c_api/TTexture.cpp index 24df4b57..9b912c2d 100644 --- a/thermion_dart/native/src/c_api/TTexture.cpp +++ b/thermion_dart/native/src/c_api/TTexture.cpp @@ -25,7 +25,6 @@ #include "Log.hpp" -#define STB_IMAGE_IMPLEMENTATION #include #ifdef __cplusplus