mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-19 17:39:50 -04:00
add a GEODE_REVERT_TODO_RETURN option for cmake
This commit is contained in:
parent
55e1f6a16c
commit
dd6e20b283
3 changed files with 12 additions and 2 deletions
|
@ -267,6 +267,9 @@ target_include_directories(GeodeBindings PUBLIC
|
|||
target_link_directories(GeodeBindings PUBLIC ${GEODE_LOADER_PATH}/include/link)
|
||||
target_link_libraries(GeodeBindings PUBLIC ghc_filesystem fmt TulipHookInclude mat-json GeodeFilesystemImpl)
|
||||
target_link_libraries(${PROJECT_NAME} INTERFACE GeodeBindings)
|
||||
if (${GEODE_REVERT_TODO_RETURN})
|
||||
target_compile_definitions(GeodeBindings PUBLIC GEODE_REVERT_TODO_RETURN)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${GEODE_BIN_PATH})
|
||||
file(MAKE_DIRECTORY ${GEODE_BIN_PATH})
|
||||
|
|
|
@ -2,7 +2,13 @@
|
|||
|
||||
struct TodoReturnPlaceholder;
|
||||
|
||||
using TodoReturn = TodoReturnPlaceholder;
|
||||
#ifdef GEODE_REVERT_TODO_RETURN
|
||||
using TodoReturn = void;
|
||||
#warning "Reverting TodoReturn to void. This behavior is deprecated and will be removed in a later update."
|
||||
#else
|
||||
#define GEODE_REVERT_TODO_RETURN 0
|
||||
using TodoReturn = TodoReturnPlaceholder;
|
||||
#endif
|
||||
|
||||
// thanks pie
|
||||
enum class SearchType {
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
using DerivedFuncType = decltype(Resolve<__VA_ARGS__>::func(&Derived::FunctionName_)); \
|
||||
if constexpr (different) { \
|
||||
static auto address = AddressInline_; \
|
||||
static_assert(!different || !std::is_same_v<typename ReturnType<BaseFuncType>::type, TodoReturn>, \
|
||||
static_assert(GEODE_REVERT_TODO_RETURN || \
|
||||
!different || !std::is_same_v<typename ReturnType<BaseFuncType>::type, TodoReturn>, \
|
||||
"Function" #ClassName_ "::" #FunctionName_ " has a TodoReturn type, " \
|
||||
"please fix it by editing the bindings." \
|
||||
); \
|
||||
|
|
Loading…
Reference in a new issue