2024-02-07 02:54:16 -05:00
cmake_minimum_required ( VERSION 3.25 FATAL_ERROR )
2024-02-12 19:21:42 -05:00
set ( CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded )
cmake_policy ( SET CMP0141 NEW )
2022-10-10 14:00:32 -04:00
set ( BUILD_SHARED_LIBS OFF CACHE BOOL "Build libraries static" FORCE )
2022-12-13 15:39:45 -05:00
2023-01-24 11:37:59 -05:00
# Docs flags
if ( GEODE_BUILDING_DOCS )
2024-02-12 19:21:42 -05:00
set ( GEODE_DISABLE_CLI_CALLS ON )
set ( GEODE_DISABLE_PRECOMPILED_HEADERS ON )
set ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
set ( GEODE_DONT_BUILD_TEST_MODS ON )
2023-01-24 11:37:59 -05:00
endif ( )
2024-02-03 06:40:44 -05:00
option ( GEODE_USE_BREAKPAD "Enables the use of the Breakpad library for crash dumps." ON )
2024-02-02 04:40:07 -05:00
2022-12-13 15:39:45 -05:00
# Read version
2022-10-11 04:37:46 -04:00
file ( READ VERSION GEODE_VERSION )
2022-10-11 16:38:01 -04:00
string ( STRIP "${GEODE_VERSION}" GEODE_VERSION )
2024-04-12 16:02:28 -04:00
set ( GEODE_VERSION "${GEODE_VERSION}" CACHE INTERNAL "Geode version" )
2024-04-12 17:56:33 -04:00
set ( GEODE_VERSION_FULL "${GEODE_VERSION}" CACHE INTERNAL "Geode version full" )
2022-10-05 08:41:05 -04:00
2022-12-13 15:39:45 -05:00
# Check if version has a tag like v1.0.0-alpha
string ( FIND ${ GEODE_VERSION } "-" GEODE_VERSION_HAS_TAG )
2023-02-22 05:19:17 -05:00
if ( NOT ${ GEODE_VERSION_HAS_TAG } EQUAL "-1" )
string ( REGEX MATCH "[a-z]+(\.[0-9]+)?$" GEODE_VERSION_TAG ${ GEODE_VERSION } )
2022-12-13 15:39:45 -05:00
string ( SUBSTRING "${GEODE_VERSION}" 0 ${ GEODE_VERSION_HAS_TAG } GEODE_VERSION )
2023-02-22 05:19:17 -05:00
string ( FIND ${ GEODE_VERSION_TAG } "." GEODE_VERSION_TAG_HAS_NUMBER )
# Extract tag type and number from tag
if ( NOT ${ GEODE_VERSION_TAG_HAS_NUMBER } EQUAL "-1" )
string ( SUBSTRING "${GEODE_VERSION_TAG}" 0 ${ GEODE_VERSION_TAG_HAS_NUMBER } GEODE_VERSION_TAG_TYPE )
math ( EXPR GEODE_VERSION_TAG_HAS_NUMBER "${GEODE_VERSION_TAG_HAS_NUMBER} + 1" )
string ( SUBSTRING "${GEODE_VERSION_TAG}" ${ GEODE_VERSION_TAG_HAS_NUMBER } -1 GEODE_VERSION_TAG_NUMBER )
else ( )
set ( GEODE_VERSION_TAG_TYPE "${GEODE_VERSION_TAG}" )
set ( GEODE_VERSION_TAG_NUMBER "" )
endif ( )
# Capitalize first letter of tag type
string ( SUBSTRING ${ GEODE_VERSION_TAG_TYPE } 0 1 FIRST_LETTER )
string ( TOUPPER ${ FIRST_LETTER } FIRST_LETTER )
string ( REGEX REPLACE "^.(.*)" "${FIRST_LETTER}\\1" GEODE_VERSION_TAG_TYPE "${GEODE_VERSION_TAG_TYPE}" )
2023-08-03 17:35:03 -04:00
message ( STATUS "Version: ${GEODE_VERSION}, tag: ${GEODE_VERSION_TAG} (type: ${GEODE_VERSION_TAG_TYPE}, number: ${GEODE_VERSION_TAG_NUMBER})" )
2022-12-13 15:39:45 -05:00
else ( )
set ( GEODE_VERSION_TAG "" )
2023-02-22 05:19:17 -05:00
set ( GEODE_VERSION_TAG_TYPE "" )
set ( GEODE_VERSION_TAG_NUMBER "" )
2022-12-13 15:39:45 -05:00
2023-08-03 17:35:03 -04:00
message ( STATUS "Version: ${GEODE_VERSION}" )
endif ( )
2022-12-13 15:39:45 -05:00
2024-02-05 02:48:17 -05:00
include ( cmake/CPM.cmake )
2024-02-11 13:58:46 -05:00
if ( NOT DEFINED CPM_SOURCE_CACHE )
message ( NOTICE "Not using CPM cache (CPM_SOURCE_CACHE). "
" I t i s r e c o m m e n d e d t o u s e i t t o i m p r o v e c o n f i g u r e t i m e s . " )
endif ( )
2024-02-05 02:48:17 -05:00
# Allow users to have their own copy of bindings that can be overwritten with a CMake option.
# If the option is not provided, by default just clone bindings with CPM and use that
if ( DEFINED ENV{GEODE_BINDINGS_REPO_PATH} )
set ( temp $ENV{ GEODE_BINDINGS_REPO_PATH } )
# this is so stupid i hate windows paths
string ( REPLACE "\\" "/" GEODE_BINDINGS_REPO_PATH ${ temp } )
endif ( )
if ( NOT GEODE_BINDINGS_REPO_PATH )
message ( STATUS
" N o o v e r r i d e p a t h f o r b i n d i n g s p r o v i d e d , u s i n g C P M t o c l o n e d e f a u l t . "
" I f y o u w o u l d l i k e t o u s e a s e p a r a t e c l o n e o f t h e b i n d i n g s r e p o "
" ( f o r e x a m p l e i n o r d e r t o b e a b l e t o e f f i c i e n t l y c h a n g e a n d "
" c o n t r i b u t e n e w b i n d i n g s ) t h e n s e t G E O D E _ B I N D I N G S _ R E P O _ P A T H t o w h e r e y o u h a v e "
" c l o n e d t h e repository ( system environment variables are supported ) . "
)
CPMAddPackage ( NAME "bindings"
G I T H U B _ R E P O S I T O R Y " g e o d e - s d k / b i n d i n g s "
G I T _ T A G " m a i n "
D O W N L O A D _ O N L Y Y E S
N O _ C A C H E Y E S
)
set ( GEODE_BINDINGS_REPO_PATH ${ bindings_SOURCE_DIR } )
else ( )
message ( STATUS "Using ${GEODE_BINDINGS_REPO_PATH} for bindings repo" )
endif ( )
2022-10-05 08:41:05 -04:00
project ( geode-sdk VERSION ${ GEODE_VERSION } LANGUAGES CXX C )
2022-07-30 12:24:03 -04:00
2024-07-16 06:53:33 -04:00
if ( NOT GEODE_DONT_USE_CCACHE )
message ( STATUS "Looking for ccache/sccache" )
if ( DEFINED CMAKE_C_COMPILER_LAUNCHER OR DEFINED CMAKE_CXX_COMPILER_LAUNCHER )
message ( STATUS "Looking for ccache/sccache - detecting variant" )
if ( DEFINED CMAKE_C_COMPILER_LAUNCHER AND DEFINED CMAKE_CXX_COMPILER_LAUNCHER AND
C M A K E _ C _ C O M P I L E R _ L A U N C H E R S T R E Q U A L C M A K E _ C X X _ C O M P I L E R _ L A U N C H E R )
if ( CMAKE_CXX_COMPILER_LAUNCHER MATCHES "sccache(|.exe)$" )
message ( STATUS "Looking for ccache/sccache - detected sccache" )
set ( GEODE_CCACHE_VARIANT "sccache" )
elseif ( CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache(|.exe)$" )
message ( STATUS "Looking for ccache/sccache - detected ccache" )
set ( GEODE_CCACHE_VARIANT "ccache" )
else ( )
message ( STATUS "Looking for ccache/sccache - none (custom compiler launcher: {CMAKE_C_COMPILER_LAUNCHER}, {CMAKE_CXX_COMPILER_LAUNCHER})" )
endif ( )
2024-02-12 19:21:42 -05:00
else ( )
2024-07-16 06:53:33 -04:00
message ( STATUS "Looking for ccache/sccache - skipped (custom compiler launcher: {CMAKE_C_COMPILER_LAUNCHER}, {CMAKE_CXX_COMPILER_LAUNCHER})" )
2024-02-12 19:21:42 -05:00
endif ( )
2024-07-16 06:53:33 -04:00
elseif ( CMAKE_GENERATOR MATCHES "Visual Studio" )
message ( STATUS "Looking for ccache/sccache - skipped (Visual Studio generator)" )
2024-02-12 19:21:42 -05:00
else ( )
2024-07-16 06:53:33 -04:00
find_program ( GEODE_CCACHE NAMES sccache ccache )
if ( GEODE_CCACHE )
if ( ${ GEODE_CCACHE } MATCHES "sccache(|.exe)$" )
set ( GEODE_CCACHE_VARIANT "sccache" )
else ( )
set ( GEODE_CCACHE_VARIANT "ccache" )
endif ( )
message ( STATUS "Looking for ccache/sccache - found ${GEODE_CCACHE_VARIANT}" )
message ( NOTICE "Compiler launcher not set but ccache/sccache was found. "
" S e t t i n g c o m p i l e r l a u n c h e r t o t h a t " )
set ( CMAKE_C_COMPILER_LAUNCHER ${ GEODE_CCACHE } )
set ( CMAKE_CXX_COMPILER_LAUNCHER ${ GEODE_CCACHE } )
2024-02-12 19:21:42 -05:00
else ( )
2024-07-16 06:53:33 -04:00
message ( STATUS "Looking for ccache/sccache - not found" )
2024-02-12 19:21:42 -05:00
endif ( )
2024-07-16 06:53:33 -04:00
unset ( GEODE_CCACHE )
2024-02-12 19:21:42 -05:00
endif ( )
2024-07-16 06:53:33 -04:00
else ( )
message ( STATUS "Not looking for ccache because GEODE_DONT_USE_CCACHE was ON" )
2024-02-12 19:21:42 -05:00
endif ( )
if ( DEFINED GEODE_CCACHE_VARIANT )
2024-02-13 14:59:32 -05:00
if ( NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS )
2024-09-05 13:42:49 -04:00
if ( ${ GEODE_CCACHE_VARIANT } STREQUAL "sccache" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
2024-09-10 13:24:50 -04:00
if ( APPLE AND DEFINED CMAKE_OSX_ARCHITECTURES AND ( CMAKE_OSX_ARCHITECTURES STREQUAL "arm64;x86_64" OR CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64;arm64" ) )
2024-09-05 06:44:11 -04:00
message ( NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID} while building multiple architectures, PCH will be disabled due to issues with sccache." )
2024-09-10 13:24:50 -04:00
message ( "(You can override this by setting GEODE_DISABLE_PRECOMPILED_HEADERS to ON)." )
2024-09-05 06:44:11 -04:00
set ( GEODE_DISABLE_PRECOMPILED_HEADERS ON )
else ( )
message ( NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be enabled." )
set ( GEODE_DISABLE_PRECOMPILED_HEADERS OFF )
endif ( )
2024-02-13 14:59:32 -05:00
else ( )
message ( NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be disabled." )
set ( GEODE_DISABLE_PRECOMPILED_HEADERS ON )
endif ( )
2024-02-12 19:21:42 -05:00
endif ( )
else ( )
2024-09-10 13:24:50 -04:00
if ( APPLE )
2024-09-05 06:44:11 -04:00
# when building for multiple architectures, a caching compiler is not recommended
message ( NOTICE "Not using a caching compiler (ccache/sccache)." )
else ( )
message ( NOTICE "Not using a caching compiler (ccache/sccache). "
" I t i s r e c o m m e n d e d t o i n s t a l l o n e t o i m p r o v e b u i l d t i m e s . " )
message ( NOTICE "We recommend sccache, check its README for installation instructions, "
" n o r m a l l y y o u c a n j u s t u s e y o u r u s u a l p a c k a g e manager ( e.g. 'scoop install sccache' ) . " )
endif ( )
2024-02-12 19:21:42 -05:00
if ( NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS )
message ( NOTICE "Because of this, PCH will be enabled." )
set ( GEODE_DISABLE_PRECOMPILED_HEADERS OFF )
endif ( )
endif ( )
if ( NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS )
set ( GEODE_DISABLE_PRECOMPILED_HEADERS OFF )
endif ( )
if ( GEODE_DISABLE_PRECOMPILED_HEADERS )
message ( STATUS "Pre-compiled headers - OFF" )
else ( )
message ( STATUS "Pre-compiled headers - ON" )
endif ( )
2022-07-30 12:24:03 -04:00
add_library ( ${ PROJECT_NAME } INTERFACE )
2022-10-11 04:37:46 -04:00
# Rerun CMake on VERSION file change
set_target_properties ( ${ PROJECT_NAME } PROPERTIES CMAKE_CONFIGURE_DEPENDS VERSION )
2022-07-30 12:24:03 -04:00
target_compile_definitions ( ${ PROJECT_NAME } INTERFACE -DPROJECT_NAME= ${ CMAKE_PROJECT_NAME } )
set ( GEODE_BIN_PATH ${ CMAKE_CURRENT_SOURCE_DIR } /bin )
set ( GEODE_LOADER_PATH ${ CMAKE_CURRENT_SOURCE_DIR } /loader )
2023-04-03 03:43:52 -04:00
set ( GEODE_ROOT_PATH ${ CMAKE_CURRENT_SOURCE_DIR } )
2022-07-30 12:24:03 -04:00
include ( cmake/Platform.cmake )
2023-10-08 09:38:17 -04:00
include ( cmake/GeodeFile.cmake )
2022-07-30 12:24:03 -04:00
2024-01-08 14:48:21 -05:00
if ( NOT DEFINED GEODE_GD_VERSION )
2024-11-09 23:28:57 -05:00
if ( GEODE_TARGET_PLATFORM STREQUAL "Win64" OR GEODE_TARGET_PLATFORM STREQUAL "MacOS" )
set ( GEODE_GD_VERSION 2.2073 )
set ( GEODE_COMP_GD_VERSION 22073 )
else ( )
set ( GEODE_GD_VERSION 2.206 )
set ( GEODE_COMP_GD_VERSION 22060 )
endif ( )
2024-01-08 14:48:21 -05:00
endif ( )
2024-09-27 15:24:46 -04:00
target_compile_definitions (
$ { P R O J E C T _ N A M E } I N T E R F A C E
G E O D E _ G D _ V E R S I O N = $ { G E O D E _ G D _ V E R S I O N }
G E O D E _ C O M P _ G D _ V E R S I O N = $ { G E O D E _ C O M P _ G D _ V E R S I O N }
G E O D E _ G D _ V E R S I O N _ S T R I N G = " $ { G E O D E _ G D _ V E R S I O N } "
)
2024-01-08 14:48:21 -05:00
2024-01-09 14:59:57 -05:00
if ( WIN32 )
# This allows you to compile in debug mode
2024-05-02 12:50:33 -04:00
# add_compile_definitions(_HAS_ITERATOR_DEBUGGING=0)
2024-01-09 14:59:57 -05:00
add_definitions ( -D_HAS_ITERATOR_DEBUGGING=0 )
2024-05-02 12:50:33 -04:00
target_compile_definitions ( ${ PROJECT_NAME } INTERFACE _HAS_ITERATOR_DEBUGGING=0 )
2024-05-31 17:18:21 -04:00
target_link_libraries ( ${ PROJECT_NAME } INTERFACE delayimp ws2_32 )
2024-02-12 19:31:21 -05:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
2024-02-11 13:58:46 -05:00
C M A K E _ C X X _ C O M P I L E R _ F R O N T E N D _ V A R I A N T S T R E Q U A L " G N U " )
# target x86 on windows with clang
2024-06-01 18:04:09 -04:00
target_compile_options ( ${ PROJECT_NAME } INTERFACE --target=x86_64-pc-windows-msvc )
target_link_options ( ${ PROJECT_NAME } INTERFACE --target=x86_64-pc-windows-msvc )
add_compile_options ( --target=x86_64-pc-windows-msvc )
add_link_options ( --target=x86_64-pc-windows-msvc )
2024-02-11 13:58:46 -05:00
endif ( )
2024-01-09 14:59:57 -05:00
endif ( )
2024-01-08 14:48:21 -05:00
2024-09-16 11:22:51 -04:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
# force an error on a missing return type, as this is unfortunately a common mistake people make
target_compile_options ( ${ PROJECT_NAME } INTERFACE -Werror=return-type )
endif ( )
2024-06-07 05:09:35 -04:00
# if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# set_property(TARGET ${PROJECT_NAME} PROPERTY LINKER_TYPE LLD)
# target_link_options(${PROJECT_NAME} INTERFACE -fuse-ld=lld)
# endif ()
2024-04-10 12:56:20 -04:00
# We do not support anything below SDK 23
if ( ANDROID )
string ( REGEX MATCH "[0-9]+" ANDROID_PLATFORM_NUMBER "${ANDROID_PLATFORM}" )
if ( ANDROID_PLATFORM_NUMBER LESS 23 )
message ( FATAL_ERROR "Specified target Android SDK version is too low (${ANDROID_PLATFORM_NUMBER}), must be 23 or higher" )
endif ( )
endif ( )
2024-01-03 18:08:05 -05:00
set ( MAT_JSON_AS_INTERFACE ON )
2024-11-11 13:25:06 -05:00
CPMAddPackage ( "gh:geode-sdk/result@1.2.0" )
CPMAddPackage ( "gh:geode-sdk/json@3.0.2" )
2024-11-09 16:33:03 -05:00
CPMAddPackage ( "gh:fmtlib/fmt#11.0.2" )
2023-05-01 06:57:46 -04:00
2023-05-24 15:17:58 -04:00
target_compile_definitions ( ${ PROJECT_NAME } INTERFACE MAT_JSON_DYNAMIC=1 )
2023-02-17 13:41:10 -05:00
# this is needed for cross compilation on linux,
# since fmtlib will fail to compile otherwise
if ( GEODE_DISABLE_FMT_CONSTEVAL )
2023-05-01 06:57:46 -04:00
message ( VERBOSE "Disabling FMT_CONSTEVAL" )
target_compile_definitions ( fmt PUBLIC -DFMT_CONSTEVAL= )
2023-02-17 13:41:10 -05:00
endif ( )
2023-02-08 09:37:37 -05:00
# Tulip hook (hooking)
if ( PROJECT_IS_TOP_LEVEL AND NOT GEODE_BUILDING_DOCS )
set ( TULIP_LINK_SOURCE ON )
endif ( )
2023-08-02 10:34:36 -04:00
set ( CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE )
2024-02-12 08:01:19 -05:00
# Allow users to have their own copy of TulipHook that can be overwritten with a CMake option.
# If the option is not provided, by default just clone TulipHook with CPM and use that
if ( DEFINED ENV{GEODE_TULIPHOOK_REPO_PATH} )
set ( temp $ENV{ GEODE_TULIPHOOK_REPO_PATH } )
# this is so stupid i hate windows paths
string ( REPLACE "\\" "/" GEODE_TULIPHOOK_REPO_PATH ${ temp } )
endif ( )
if ( DEFINED GEODE_TULIPHOOK_REPO_PATH )
message ( STATUS "Using ${GEODE_TULIPHOOK_REPO_PATH} for TulipHook" )
add_subdirectory ( ${ GEODE_TULIPHOOK_REPO_PATH } ${ GEODE_TULIPHOOK_REPO_PATH } /build )
else ( )
2024-11-11 13:37:25 -05:00
CPMAddPackage ( "gh:geode-sdk/TulipHook@2.4.0" )
2024-02-12 08:01:19 -05:00
endif ( )
2023-08-02 10:34:36 -04:00
set ( CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE )
include ( CheckCXXCompilerFlag )
check_cxx_compiler_flag ( -Wno-everything SUPPORTS_W_NO_EVERYTHING )
if ( SUPPORTS_W_NO_EVERYTHING )
2024-02-11 13:58:46 -05:00
# Silence warnings from dependencies
2023-08-05 14:25:33 -04:00
if ( TARGET capstone )
target_compile_options ( capstone PRIVATE -Wno-everything )
2023-08-02 11:27:38 -04:00
endif ( )
2023-08-02 10:34:36 -04:00
endif ( )
2023-02-08 09:37:37 -05:00
2022-07-30 12:24:03 -04:00
target_sources ( ${ PROJECT_NAME } INTERFACE ${ CMAKE_CURRENT_SOURCE_DIR } /entry.cpp )
2024-02-05 02:48:17 -05:00
add_subdirectory ( ${ GEODE_BINDINGS_REPO_PATH } ${ CMAKE_BINARY_DIR } /bindings )
2023-12-20 07:23:21 -05:00
2024-02-12 08:22:17 -05:00
if ( NOT GEODE_DISABLE_PRECOMPILED_HEADERS )
target_precompile_headers ( GeodeBindings INTERFACE
2024-02-25 16:05:13 -05:00
" $ < $ < C O M P I L E _ L A N G U A G E : C X X > : $ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e / G e o d e / B i n d i n g s . h p p > "
2024-02-12 08:22:17 -05:00
)
endif ( )
2024-02-04 14:45:52 -05:00
target_include_directories ( GeodeBindings PUBLIC
2022-07-30 12:24:03 -04:00
$ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e
2022-10-17 08:46:36 -04:00
$ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e / G e o d e / c o c o s / i n c l u d e
2022-07-30 12:24:03 -04:00
$ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e / G e o d e / c o c o s / e x t e n s i o n s
$ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e / G e o d e / f m o d
)
2024-02-04 14:45:52 -05:00
target_link_directories ( GeodeBindings PUBLIC ${ GEODE_LOADER_PATH } /include/link )
2024-11-04 15:24:20 -05:00
target_link_libraries ( GeodeBindings PUBLIC fmt TulipHookInclude mat-json GeodeResult )
2024-02-07 05:02:51 -05:00
target_link_libraries ( ${ PROJECT_NAME } INTERFACE GeodeBindings )
2022-08-08 14:18:09 -04:00
2022-07-30 12:24:03 -04:00
if ( NOT EXISTS ${ GEODE_BIN_PATH } )
2024-02-03 12:28:47 -05:00
file ( MAKE_DIRECTORY ${ GEODE_BIN_PATH } )
2022-07-30 12:24:03 -04:00
endif ( )
2022-12-08 22:15:10 -05:00
if ( NOT EXISTS ${ GEODE_BIN_PATH } / ${ PROJECT_VERSION } AND EXISTS ${ GEODE_BIN_PATH } /nightly/ )
set ( GEODE_LINK_NIGHTLY 1 )
endif ( )
2022-07-30 12:24:03 -04:00
2022-10-03 01:06:27 -04:00
if ( ${ GEODE_LINK_NIGHTLY } )
2022-07-30 12:24:03 -04:00
set ( GEODE_PLATFORM_BIN_PATH ${ GEODE_BIN_PATH } /nightly/ ${ GEODE_PLATFORM_BINARY } )
else ( )
set ( GEODE_PLATFORM_BIN_PATH ${ GEODE_BIN_PATH } / ${ PROJECT_VERSION } / ${ GEODE_PLATFORM_BINARY } )
endif ( )
if ( PROJECT_IS_TOP_LEVEL )
2022-08-08 14:18:09 -04:00
add_subdirectory ( loader )
2022-07-30 12:24:03 -04:00
target_link_libraries ( ${ PROJECT_NAME } INTERFACE geode-loader )
2024-02-11 13:58:46 -05:00
if ( SUPPORTS_W_NO_EVERYTHING )
target_compile_options ( geode-loader PRIVATE -Wno-inconsistent-missing-override )
endif ( )
2024-02-12 08:22:17 -05:00
elseif ( EXISTS ${ GEODE_PLATFORM_BIN_PATH } )
2022-07-30 12:24:03 -04:00
target_link_libraries ( ${ PROJECT_NAME } INTERFACE "${GEODE_PLATFORM_BIN_PATH}" )
2024-02-12 08:22:17 -05:00
if ( NOT GEODE_DISABLE_PRECOMPILED_HEADERS )
target_precompile_headers ( ${ PROJECT_NAME } INTERFACE
2024-02-25 16:05:13 -05:00
" $ < $ < C O M P I L E _ L A N G U A G E : C X X > : $ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e / G e o d e / D e f a u l t I n c l u d e . h p p > "
" $ < $ < C O M P I L E _ L A N G U A G E : C X X > : $ { G E O D E _ L O A D E R _ P A T H } / i n c l u d e / G e o d e / G e o d e . h p p > "
2024-02-12 08:22:17 -05:00
# please stop adding modify here its not here because it makes windows compilation take longer than geode 1.0 release date
)
endif ( )
2022-07-30 12:24:03 -04:00
else ( )
2022-10-17 08:46:36 -04:00
message ( FATAL_ERROR
2024-02-11 13:58:46 -05:00
" N o v a l i d l o a d e r b i n a r y t o l i n k t o ! I n s t a l l p r e - b u i l t b i n a r i e s w i t h ` g e o d e s d k i n s t a l l - b i n a r i e s ` , "
2023-02-02 20:06:23 -05:00
" o r b u i l d G e o d e f r o m s o u r c e a n d a d d ` set ( GEODE_LINK_NIGHTLY ON ) ` t o y o u r C M a k e L i s t s . t x t "
2022-12-08 17:28:05 -05:00
" i n t h e l i n e b e f o r e c a l l i n g a d d _ s u b d i r e c t o r y f o r G e o d e . "
2022-10-17 08:46:36 -04:00
)
2022-07-30 12:24:03 -04:00
endif ( )