otclient-redemption/tests/CMakeLists.txt
Luan Santos 388b3ba2ea
feat(platform): add native Cocoa/AppKit windowing for macOS (#1559)
New Features:
- Native macOS app with Cocoa windowing, OpenGL view, improved input, clipboard and cursor handling.
- Platform-aware keyboard and shortcut behavior with clearer primary/meta/control semantics and normalized key combos.

Bug Fixes:
- Expanded detection for "connection refused" network errors.

Chores:
- macOS build/bundle and packaging improvements; new dependency overlay added; CI now runs macOS build when relevant.

Tests:
- AddressSanitizer support added for test builds.
2026-05-16 13:06:48 -03:00

65 lines
1.8 KiB
CMake

find_package(GTest CONFIG REQUIRED)
include(GoogleTest)
function(otclient_add_gtest TARGET_NAME)
add_executable(${TARGET_NAME} ${ARGN})
set_target_properties(${TARGET_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)
if(TOGGLE_PRE_COMPILED_HEADER)
target_precompile_headers(${TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/framework/pch.h)
endif()
target_link_libraries(${TARGET_NAME}
PRIVATE
otclient_core
GTest::gtest
GTest::gtest_main
)
if(ANDROID)
target_link_libraries(${TARGET_NAME}
PRIVATE
log
c
)
endif()
target_compile_definitions(${TARGET_NAME}
PRIVATE
CLIENT
FRAMEWORK_GRAPHICS
FRAMEWORK_NET
FRAMEWORK_SOUND
FRAMEWORK_XML
)
if(ASAN_ENABLED)
if(MSVC)
target_compile_options(${TARGET_NAME} PRIVATE /fsanitize=address)
target_link_options(${TARGET_NAME} PRIVATE /fsanitize=address)
else()
target_compile_options(${TARGET_NAME} PRIVATE -fsanitize=address)
target_link_options(${TARGET_NAME} PRIVATE -fsanitize=address)
endif()
endif()
if(MSVC)
target_compile_options(${TARGET_NAME} PRIVATE /utf-8)
if(BUILD_STATIC_LIBRARY)
set_property(TARGET ${TARGET_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else()
set_property(TARGET ${TARGET_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
endif()
gtest_discover_tests(${TARGET_NAME})
endfunction()
add_subdirectory(map)
add_subdirectory(stdext)
add_subdirectory(otml)