From 26f3ad225d30248751d2cbd91d4a37e7c808f9f1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 6 Aug 2025 16:36:27 +0000 Subject: [PATCH 1/3] Checkpoint before follow-up message Co-authored-by: izzynochill --- CMakeLists.txt | 11 ----------- libultraship/cmake/dependencies/android.cmake | 11 ++++++++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d619a0651..920a20641d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,16 +374,6 @@ 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) - FetchContent_Declare( - spdlog - GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.13.0 - ) - FetchContent_MakeAvailable(spdlog) - set(SPDLOG_INCLUDE_DIRS ${spdlog_SOURCE_DIR}/include ${spdlog_BINARY_DIR} CACHE INTERNAL "spdlog include paths") - include_directories(${SPDLOG_INCLUDE_DIRS}) # Add torch include directories for Android builds include_directories(${CMAKE_CURRENT_SOURCE_DIR}/torch) @@ -430,7 +420,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} diff --git a/libultraship/cmake/dependencies/android.cmake b/libultraship/cmake/dependencies/android.cmake index d409ca849c..217f089a5a 100644 --- a/libultraship/cmake/dependencies/android.cmake +++ b/libultraship/cmake/dependencies/android.cmake @@ -81,4 +81,13 @@ if (NOT ${spdlog_FOUND}) FetchContent_MakeAvailable(spdlog) endif() -target_link_libraries(ImGui PUBLIC SDL2::SDL2) +# Link SDL2 to ImGui - use the correct target name for FetchContent +if(TARGET SDL2::SDL2) + target_link_libraries(ImGui PUBLIC SDL2::SDL2) +elseif(TARGET SDL2-static) + target_link_libraries(ImGui PUBLIC SDL2-static) +elseif(TARGET SDL2) + target_link_libraries(ImGui PUBLIC SDL2) +else() + message(WARNING "No SDL2 target found for ImGui linking") +endif() From 73d8a0ccdd12da5b9f909f9bb2f1ebe78004026d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 6 Aug 2025 16:36:41 +0000 Subject: [PATCH 2/3] Link ImGui to SDL2 using the SDL2::SDL2 target Co-authored-by: izzynochill --- libultraship/cmake/dependencies/android.cmake | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libultraship/cmake/dependencies/android.cmake b/libultraship/cmake/dependencies/android.cmake index 217f089a5a..d409ca849c 100644 --- a/libultraship/cmake/dependencies/android.cmake +++ b/libultraship/cmake/dependencies/android.cmake @@ -81,13 +81,4 @@ if (NOT ${spdlog_FOUND}) FetchContent_MakeAvailable(spdlog) endif() -# Link SDL2 to ImGui - use the correct target name for FetchContent -if(TARGET SDL2::SDL2) - target_link_libraries(ImGui PUBLIC SDL2::SDL2) -elseif(TARGET SDL2-static) - target_link_libraries(ImGui PUBLIC SDL2-static) -elseif(TARGET SDL2) - target_link_libraries(ImGui PUBLIC SDL2) -else() - message(WARNING "No SDL2 target found for ImGui linking") -endif() +target_link_libraries(ImGui PUBLIC SDL2::SDL2) From 51c8ccc4632e9d55e5d71653a1dd947147f8a580 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 6 Aug 2025 16:39:09 +0000 Subject: [PATCH 3/3] Improve spdlog dependency handling for Android build Co-authored-by: izzynochill --- CMakeLists.txt | 9 ++++++++ libultraship/cmake/dependencies/android.cmake | 21 +++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 920a20641d..ba44f4e43a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -375,6 +375,15 @@ if(ANDROID) # Add libzip include directories globally for all targets include_directories(${LIBZIP_INCLUDE_DIRS}) + # 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.14.1 + ) + FetchContent_MakeAvailable(spdlog) + # Add torch include directories for Android builds include_directories(${CMAKE_CURRENT_SOURCE_DIR}/torch) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/torch/lib) diff --git a/libultraship/cmake/dependencies/android.cmake b/libultraship/cmake/dependencies/android.cmake index d409ca849c..f2b654ead3 100644 --- a/libultraship/cmake/dependencies/android.cmake +++ b/libultraship/cmake/dependencies/android.cmake @@ -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)