Compare commits

..

1 Commits

Author SHA1 Message Date
Wunkolo
9aa9e31510 cmake: Allow Catch test discovery
Allows individual unit-tests to be discovered, tested, and debugged by IDEs without having to run _all_ of the unit-tests just to debug one specific test.
2026-04-04 16:39:11 -07:00
8 changed files with 5 additions and 50 deletions

View File

@ -126,8 +126,7 @@ CMAKE_DEPENDENT_OPTION(ENABLE_LIBUSB "Enable libusb for GameCube Adapter support
CMAKE_DEPENDENT_OPTION(ENABLE_SOFTWARE_RENDERER "Enables the software renderer" ON "NOT ANDROID" OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_OPENGL "Enables the OpenGL renderer" ${DEFAULT_ENABLE_OPENGL} "NOT APPLE" OFF)
# NetBSD doesn't support Vulkan yet, remove this check when it does.
CMAKE_DEPENDENT_OPTION(ENABLE_VULKAN "Enables the Vulkan renderer" ON "NOT (BSD MATCHES \"NetBSD\")" OFF)
option(ENABLE_VULKAN "Enables the Vulkan renderer" ON)
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)

View File

@ -1,11 +0,0 @@
function(disable_pax_mprotect target)
if (BSD STREQUAL "NetBSD")
add_custom_command(TARGET ${target} POST_BUILD
COMMAND paxctl +m "$<TARGET_FILE:${target}>"
COMMENT "Disabling PaX MPROTECT restrictions for '${target}'"
VERBATIM
)
else()
message(FATAL_ERROR "disable_pax_mprotect only applies on NetBSD.")
endif()
endfunction()

View File

@ -60,7 +60,7 @@ if (ENABLE_TESTS)
add_subdirectory(catch2)
endif()
target_link_libraries(catch2 INTERFACE Catch2::Catch2WithMain)
include(Catch)
include(Catch)
endif()
# Crypto++
@ -500,15 +500,6 @@ if (ENABLE_VULKAN)
else()
target_include_directories(vulkan-headers INTERFACE ./vulkan-headers/include)
target_disable_warnings(vulkan-headers)
if (BSD STREQUAL "NetBSD")
# There may be a better way to do this with
# find_package(X11), but I couldn't get
# CMake to do it, so we're depending on
# the x11-links package and assuming the
# prefix location. -OS
target_include_directories(vulkan-headers INTERFACE
/usr/pkg/share/x11-links/include)
endif()
endif()
# adrenotools
@ -529,4 +520,4 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|armv8")
else()
target_compile_definitions(xxhash PRIVATE XXH_VECTOR=XXH_SCALAR)
message(STATUS "Disabling SIMD for xxHash")
endif()
endif()

View File

@ -31,11 +31,6 @@ add_library(azahar_libretro SHARED
create_target_directory_groups(azahar_libretro)
if (BSD STREQUAL "NetBSD")
include(DisablePaxMprotect)
disable_pax_mprotect(azahar_libretro)
endif()
target_link_libraries(citra_common PRIVATE libretro)
target_link_libraries(citra_core PRIVATE libretro)
target_link_libraries(video_core PRIVATE libretro)

View File

@ -6,11 +6,6 @@ add_executable(citra_meta
set_target_properties(citra_meta PROPERTIES OUTPUT_NAME "azahar")
if (BSD STREQUAL "NetBSD")
include(DisablePaxMprotect)
disable_pax_mprotect(citra_meta)
endif()
if (APPLE)
set(DIST_DIR "../../dist/apple")
set(APPLE_RESOURCES

View File

@ -4,11 +4,6 @@ add_executable(citra_room_standalone
set_target_properties(citra_room_standalone PROPERTIES OUTPUT_NAME "azahar-room")
if (BSD STREQUAL "NetBSD")
include(DisablePaxMprotect)
disable_pax_mprotect(citra_room_standalone)
endif()
target_link_libraries(citra_room_standalone PRIVATE citra_room)
if(UNIX AND NOT APPLE)

View File

@ -23,11 +23,6 @@ add_executable(tests
create_target_directory_groups(tests)
if (BSD STREQUAL "NetBSD")
include(DisablePaxMprotect)
disable_pax_mprotect(tests)
endif()
target_link_libraries(tests PRIVATE citra_common citra_core video_core audio_core)
target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch2 nihstro-headers Threads::Threads)
@ -36,10 +31,7 @@ if (ENABLE_LIBRETRO)
endif()
add_test(NAME tests COMMAND tests)
if(NOT ANDROID)
catch_discover_tests(tests)
endif()
catch_discover_tests(tests)
if (CITRA_USE_PRECOMPILED_HEADERS)
target_precompile_headers(tests PRIVATE precompiled_headers.h)

View File

@ -1,10 +1,9 @@
// Copyright Citra Emulator Project / Azahar Emulator Project
// Copyright 2023 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <bit>
#include <boost/serialization/binary_object.hpp>
#include "common/vector_math.h"