set mod suffix properly based on platform

This commit is contained in:
mat 2023-12-25 10:45:53 -03:00
parent aad4322e1b
commit d76c40e981
2 changed files with 8 additions and 3 deletions

View file

@ -216,8 +216,10 @@ function(setup_geode_mod proname)
# Add package target + make output name the mod id
set_target_properties(${proname} PROPERTIES PREFIX "")
if (DEFINED GEODE_MOD_BINARY_SUFFIX)
set_target_properties(${proname} PROPERTIES SUFFIX ${GEODE_MOD_BINARY_SUFFIX})
endif()
set_target_properties(${proname} PROPERTIES OUTPUT_NAME ${MOD_ID})
endfunction()
function(create_geode_file proname)

View file

@ -31,6 +31,7 @@ if (GEODE_TARGET_PLATFORM STREQUAL "iOS")
set(GEODE_OUTPUT_NAME "GeodeIOS")
set(GEODE_PLATFORM_BINARY "GeodeIOS.dylib")
set(GEODE_MOD_BINARY_SUFFIX ".dylib" CACHE STRING "" FORCE)
elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
set_target_properties(${PROJECT_NAME} PROPERTIES
SYSTEM_NAME MacOS
@ -62,7 +63,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
set(GEODE_OUTPUT_NAME "Geode")
set(GEODE_PLATFORM_BINARY "Geode.dylib")
set(GEODE_MOD_BINARY_SUFFIX ".ios.dylib" CACHE STRING "" FORCE)
elseif (GEODE_TARGET_PLATFORM STREQUAL "Win32")
set_target_properties(${PROJECT_NAME} PROPERTIES
SYSTEM_NAME Win32
@ -83,6 +84,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Win32")
# Windows links against .lib and not .dll
set(GEODE_OUTPUT_NAME "Geode")
set(GEODE_PLATFORM_BINARY "Geode.lib")
set(GEODE_MOD_BINARY_SUFFIX ".dll" CACHE STRING "" FORCE)
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32")
set_target_properties(${PROJECT_NAME} PROPERTIES
SYSTEM_NAME Android
@ -98,7 +100,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32")
set(GEODE_OUTPUT_NAME "Geode.armeabi-v7a")
set(GEODE_PLATFORM_BINARY "Geode.armeabi-v7a.so")
set(GEODE_MOD_BINARY_SUFFIX ".v7.so" CACHE STRING "" FORCE)
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64")
set_target_properties(${PROJECT_NAME} PROPERTIES
SYSTEM_NAME Android
@ -114,6 +116,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64")
set(GEODE_OUTPUT_NAME "Geode.arm64-v8a")
set(GEODE_PLATFORM_BINARY "Geode.arm64-v8a.so")
set(GEODE_MOD_BINARY_SUFFIX ".v8.so" CACHE STRING "" FORCE)
else()
message(FATAL_ERROR "Unknown platform ${GEODE_TARGET_PLATFORM}")
endif()