2020-08-19 08:19:28 +00:00
|
|
|
enable_testing()
|
|
|
|
add_custom_target(unittests)
|
2023-01-29 05:44:50 +00:00
|
|
|
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
|
2020-08-19 08:19:28 +00:00
|
|
|
|
|
|
|
macro(add_pcsx2_test target)
|
2021-07-04 05:24:21 +00:00
|
|
|
add_executable(${target} EXCLUDE_FROM_ALL ${ARGN})
|
2023-01-04 09:49:41 +00:00
|
|
|
target_link_libraries(${target} PRIVATE gtest gtest_main)
|
|
|
|
if(APPLE)
|
|
|
|
# For some reason this doesn't get pulled in implicitly...
|
|
|
|
target_link_libraries(${target} PRIVATE
|
|
|
|
"-framework Foundation"
|
|
|
|
"-framework Cocoa"
|
2023-01-03 12:23:10 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-07-04 05:24:21 +00:00
|
|
|
add_dependencies(unittests ${target})
|
|
|
|
add_test(NAME ${target} COMMAND ${target})
|
2023-08-24 03:47:37 +00:00
|
|
|
|
|
|
|
if(MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
# For some reason, the stack refuses to grow with the latest MSVC updates.
|
|
|
|
# Just force the commit size to 1MB for now.
|
|
|
|
set_target_properties(${target} PROPERTIES LINK_FLAGS "/STACK:1048576,1048576")
|
|
|
|
endif()
|
2020-08-19 08:19:28 +00:00
|
|
|
endmacro()
|
|
|
|
|
2022-12-28 14:02:53 +00:00
|
|
|
add_subdirectory(gtest)
|
2022-11-25 22:18:20 +00:00
|
|
|
add_subdirectory(common)
|
2023-01-04 09:49:41 +00:00
|
|
|
add_subdirectory(core)
|