2024-01-04 07:48:38 -05:00
|
|
|
include(cmake/PlatformDetect.cmake)
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
if (NOT ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
|
|
|
|
set(GEODE_TARGET_PLATFORM GEODE_TARGET_PLATFORM PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (GEODE_TARGET_PLATFORM STREQUAL "iOS")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME iOS
|
|
|
|
OSX_SYSROOT ${GEODE_IOS_SDK}
|
|
|
|
OSX_ARCHITECTURES arm64
|
|
|
|
)
|
|
|
|
|
2024-04-21 11:05:42 -04:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode.ios")
|
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.ios.dylib")
|
2024-01-21 12:33:19 -05:00
|
|
|
set(GEODE_MOD_BINARY_SUFFIX ".ios.dylib" CACHE STRING "" FORCE)
|
2022-07-30 12:24:03 -04:00
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME MacOS
|
|
|
|
)
|
|
|
|
|
2024-06-06 08:13:42 -04:00
|
|
|
# for some reason, this value is initialized as an empty string by default. idk why
|
|
|
|
if (NOT DEFINED CMAKE_OSX_ARCHITECTURES OR CMAKE_OSX_ARCHITECTURES STREQUAL "")
|
|
|
|
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
|
|
|
|
endif()
|
2024-06-01 23:30:43 -04:00
|
|
|
|
2023-01-31 05:11:31 -05:00
|
|
|
# only exists as a global property
|
2024-01-29 07:24:33 -05:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
2023-01-31 05:11:31 -05:00
|
|
|
|
2023-04-03 01:21:23 -04:00
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
2023-08-04 14:22:09 -04:00
|
|
|
"-framework Cocoa"
|
2023-09-10 08:53:34 -04:00
|
|
|
"-framework OpenGL"
|
2024-05-31 14:10:40 -04:00
|
|
|
"-framework SystemConfiguration"
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libfmod.dylib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libssl.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libcrypto.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libnghttp2.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libngtcp2.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libnghttp3.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libngtcp2_crypto_boringssl.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/macos/libcurl.a
|
2023-04-03 01:21:23 -04:00
|
|
|
)
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-11-21 12:10:19 -05:00
|
|
|
target_compile_definitions(${PROJECT_NAME} INTERFACE
|
|
|
|
-DCommentType=CommentTypeDummy
|
2024-02-04 05:55:34 -05:00
|
|
|
-DGL_SILENCE_DEPRECATION
|
2023-11-21 12:10:19 -05:00
|
|
|
)
|
|
|
|
|
2023-12-23 08:15:55 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode")
|
2022-07-30 12:24:03 -04:00
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.dylib")
|
2024-01-21 12:33:19 -05:00
|
|
|
set(GEODE_MOD_BINARY_SUFFIX ".dylib" CACHE STRING "" FORCE)
|
2024-06-10 13:18:17 -04:00
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "Win64")
|
2022-07-30 12:24:03 -04:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
2024-06-10 13:18:17 -04:00
|
|
|
SYSTEM_NAME Win64
|
|
|
|
GENERATOR_PLATFORM x64
|
2022-07-30 12:24:03 -04:00
|
|
|
)
|
|
|
|
|
2022-12-31 07:33:15 -05:00
|
|
|
target_compile_definitions(${PROJECT_NAME} INTERFACE NOMINMAX)
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
2024-06-01 17:13:06 -04:00
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/libcocos2d.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/libExtensions.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/ssl.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/crypto.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/nghttp2.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/ngtcp2.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/nghttp3.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/ngtcp2_crypto_boringssl.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/libcurl.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/glew32.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/gdstring.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/win64/fmod.lib
|
2023-12-26 22:35:39 -05:00
|
|
|
opengl32
|
2022-07-30 12:24:03 -04:00
|
|
|
)
|
|
|
|
|
2022-08-08 18:13:21 -04:00
|
|
|
# Windows links against .lib and not .dll
|
2023-12-23 08:15:55 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode")
|
2022-08-08 18:13:21 -04:00
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.lib")
|
2023-12-25 08:45:53 -05:00
|
|
|
set(GEODE_MOD_BINARY_SUFFIX ".dll" CACHE STRING "" FORCE)
|
2023-12-23 08:10:23 -05:00
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME Android
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
2024-02-25 05:54:56 -05:00
|
|
|
c
|
2023-12-23 08:10:23 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libssl.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libcrypto.a
|
2024-03-01 18:45:57 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libnghttp2.a
|
2024-05-31 05:53:04 -04:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libngtcp2.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libnghttp3.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libngtcp2_crypto_boringssl.a
|
2024-03-01 18:45:57 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libcurl.a
|
2023-12-23 08:10:23 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libcocos2dcpp.so
|
2024-01-25 20:04:20 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libfmod.so
|
2023-12-26 22:35:39 -05:00
|
|
|
GLESv2
|
2023-12-23 08:10:23 -05:00
|
|
|
log
|
|
|
|
)
|
|
|
|
|
2024-01-18 15:28:21 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode.android32")
|
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.android32.so")
|
|
|
|
set(GEODE_MOD_BINARY_SUFFIX ".android32.so" CACHE STRING "" FORCE)
|
2023-12-23 08:10:23 -05:00
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64")
|
2023-06-05 20:42:22 -04:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME Android
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
2024-02-25 05:54:56 -05:00
|
|
|
c
|
2024-01-01 13:08:45 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libssl.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libcrypto.a
|
2024-03-01 18:45:57 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libnghttp2.a
|
2024-05-31 05:53:04 -04:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libngtcp2.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libnghttp3.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libngtcp2_crypto_boringssl.a
|
2024-03-01 18:45:57 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libcurl.a
|
2023-12-23 09:33:16 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libcocos2dcpp.so
|
2024-01-25 20:04:20 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/android64/libfmod.so
|
2024-01-01 13:08:45 -05:00
|
|
|
GLESv2
|
2023-06-05 20:42:22 -04:00
|
|
|
log
|
|
|
|
)
|
|
|
|
|
2024-01-18 15:28:21 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode.android64")
|
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.android64.so")
|
|
|
|
set(GEODE_MOD_BINARY_SUFFIX ".android64.so" CACHE STRING "" FORCE)
|
2023-12-23 08:10:23 -05:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown platform ${GEODE_TARGET_PLATFORM}")
|
2022-07-30 12:24:03 -04:00
|
|
|
endif()
|