Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,15 @@ if(ANDROID)
set(LIBZIP_INCLUDE_DIRS ${libzip_SOURCE_DIR}/lib ${libzip_BINARY_DIR} CACHE INTERNAL "libzip include paths")
# Add libzip include directories globally for all targets
include_directories(${LIBZIP_INCLUDE_DIRS})
# Fetch spdlog for Android
include(FetchContent)

# Fetch spdlog for Android - must be done before torch and libultraship
# Use the same version as libultraship to avoid conflicts
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.13.0
GIT_TAG v1.14.1
)
FetchContent_MakeAvailable(spdlog)
set(SPDLOG_INCLUDE_DIRS ${spdlog_SOURCE_DIR}/include ${spdlog_BINARY_DIR} CACHE INTERNAL "spdlog include paths")
include_directories(${SPDLOG_INCLUDE_DIRS})
Comment on lines +377 to -386

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing this duplicate spdlog declaration is the correct approach to fix the build errors on Android.

However, there might be a lingering issue with the spdlog version being used. libultraship/cmake/dependencies/common.cmake declares spdlog v1.13.0, and it's included before libultraship/cmake/dependencies/android.cmake, which declares v1.14.1. Because of the if (NOT ${spdlog_FOUND}) check in android.cmake, the v1.14.1 declaration will be skipped, and Android will end up using v1.13.0 from common.cmake.

If the intention is for Android to use v1.14.1, you might need to adjust the logic in libultraship's CMake files, for example by removing the spdlog handling from common.cmake when building for Android.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to build in GitHub actions with android compile

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent try to build in GitHub actions with the android-compile.yml

@cursor cursor Bot Aug 6, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to trigger the GitHub Actions workflow for the Android build, but after several attempts using the GitHub CLI (which I had to install and authenticate), I discovered that the access token I was using didn't have the necessary permissions to trigger workflows directly. I was able to list workflows and see their statuses, confirming that recent Android builds had failed.

Since I couldn't trigger the build, I've ensured that the changes I made to fix the spdlog dependency order are committed and pushed. These changes involve:

  • Modifying CMakeLists.txt: I added the spdlog declaration for Android before torch and libultraship are included, using version v1.14.1 to match libultraship's version. This ensures spdlog is available when torch tries to find it.
  • Updating libultraship/cmake/dependencies/android.cmake: I added target checks to prevent duplicate spdlog declarations and preserved the SDL2 linking for ImGui.

Because I can't trigger the workflow myself, you'll need to manually trigger the "Android Build" workflow from your GitHub repository's "Actions" tab, selecting the cursor/fix-spdlog-dependency-order-error-ba4a branch. Alternatively, you can push a small, empty commit to trigger the workflow. The build should now succeed as spdlog is declared correctly, torch will find it, and libultraship will skip its own declaration, preventing version conflicts.


Open in Cursor Open in Web

Learn more about Cursor Agents


# Add torch include directories for Android builds
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/torch)
Expand Down Expand Up @@ -430,7 +429,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/extern/tinyxml2
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/libultraship/Lib/
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/libultraship/Lib/libjpeg/include/
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/libultraship/Lib/spdlog/include/
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/U64/PR
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic
${SDL2_INCLUDE_DIRS}
Expand Down
21 changes: 12 additions & 9 deletions libultraship/cmake/dependencies/android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,18 @@ if (NOT ${tinyxml2_FOUND})
endif()

#=================== spdlog ===================
find_package(spdlog QUIET)
if (NOT ${spdlog_FOUND})
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.1
OVERRIDE_FIND_PACKAGE
)
FetchContent_MakeAvailable(spdlog)
# Check if spdlog is already available (declared by parent project)
if(NOT TARGET spdlog::spdlog AND NOT TARGET spdlog)
find_package(spdlog QUIET)
if (NOT ${spdlog_FOUND})
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.1
OVERRIDE_FIND_PACKAGE
)
FetchContent_MakeAvailable(spdlog)
endif()
endif()

target_link_libraries(ImGui PUBLIC SDL2::SDL2)
Loading