From 98f82ff00e320971daa4166ae2016fd99e0627b3 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:21:58 +0300 Subject: [PATCH] fix platform-specific dependencies through Cli 3.2.0 --- cmake/GeodeFile.cmake | 11 ++++++++++- cmake/Platform.cmake | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/GeodeFile.cmake b/cmake/GeodeFile.cmake index 9c21103c..143b8f93 100644 --- a/cmake/GeodeFile.cmake +++ b/cmake/GeodeFile.cmake @@ -119,7 +119,16 @@ function(setup_geode_mod proname) endif() # Check dependencies using CLI - if (${GEODE_CLI_VERSION} VERSION_GREATER_EQUAL "2.0.0") + if (${GEODE_CLI_VERSION} VERSION_GREATER_EQUAL "3.2.0") + execute_process( + COMMAND ${GEODE_CLI} project check ${CMAKE_CURRENT_BINARY_DIR} + --externals ${GEODE_MODS_BEING_BUILT} ${DONT_UPDATE_INDEX_ARG} + --platform ${GEODE_TARGET_PLATFORM_SHORT} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND_ERROR_IS_FATAL ANY + ) + elseif (${GEODE_CLI_VERSION} VERSION_GREATER_EQUAL "2.0.0") + message(WARNING "If you use platform-specific dependencies, upgrade Geode CLI to version 3.2.0 or greater!") execute_process( COMMAND ${GEODE_CLI} project check ${CMAKE_CURRENT_BINARY_DIR} --externals ${GEODE_MODS_BEING_BUILT} ${DONT_UPDATE_INDEX_ARG} diff --git a/cmake/Platform.cmake b/cmake/Platform.cmake index a1fd167a..36fbce4f 100644 --- a/cmake/Platform.cmake +++ b/cmake/Platform.cmake @@ -14,6 +14,7 @@ if (GEODE_TARGET_PLATFORM STREQUAL "iOS") set(GEODE_OUTPUT_NAME "Geode.ios") set(GEODE_PLATFORM_BINARY "Geode.ios.dylib") set(GEODE_MOD_BINARY_SUFFIX ".ios.dylib" CACHE STRING "" FORCE) + set(GEODE_TARGET_PLATFORM_SHORT "ios" PARENT_SCOPE) elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS") set_target_properties(${PROJECT_NAME} PROPERTIES SYSTEM_NAME MacOS @@ -49,6 +50,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS") set(GEODE_OUTPUT_NAME "Geode") set(GEODE_PLATFORM_BINARY "Geode.dylib") set(GEODE_MOD_BINARY_SUFFIX ".dylib" CACHE STRING "" FORCE) + set(GEODE_TARGET_PLATFORM_SHORT "mac" PARENT_SCOPE) elseif (GEODE_TARGET_PLATFORM STREQUAL "Win64") set_target_properties(${PROJECT_NAME} PROPERTIES SYSTEM_NAME Win64 @@ -77,6 +79,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Win64") set(GEODE_OUTPUT_NAME "Geode") set(GEODE_PLATFORM_BINARY "Geode.lib") set(GEODE_MOD_BINARY_SUFFIX ".dll" CACHE STRING "" FORCE) + set(GEODE_TARGET_PLATFORM_SHORT "win" PARENT_SCOPE) elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32") set_target_properties(${PROJECT_NAME} PROPERTIES SYSTEM_NAME Android @@ -101,6 +104,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32") set(GEODE_OUTPUT_NAME "Geode.android32") set(GEODE_PLATFORM_BINARY "Geode.android32.so") set(GEODE_MOD_BINARY_SUFFIX ".android32.so" CACHE STRING "" FORCE) + set(GEODE_TARGET_PLATFORM_SHORT "android32" PARENT_SCOPE) elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64") set_target_properties(${PROJECT_NAME} PROPERTIES SYSTEM_NAME Android @@ -130,6 +134,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64") set(GEODE_OUTPUT_NAME "Geode.android64") set(GEODE_PLATFORM_BINARY "Geode.android64.so") set(GEODE_MOD_BINARY_SUFFIX ".android64.so" CACHE STRING "" FORCE) + set(GEODE_TARGET_PLATFORM_SHORT "android64" PARENT_SCOPE) else() message(FATAL_ERROR "Unknown platform ${GEODE_TARGET_PLATFORM}") endif()