mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
cmake+tests: include SDL_build_config.h in select tests + add include paths
This commit is contained in:
parent
0bd5ce13db
commit
c30903882b
3 changed files with 22 additions and 5 deletions
|
@ -30,6 +30,12 @@ if(NOT TARGET SDL3::${sdl_name_component})
|
||||||
find_package(SDL3 3.0.0 REQUIRED CONFIG COMPONENTS ${sdl_name_component} SDL3_test)
|
find_package(SDL3 3.0.0 REQUIRED CONFIG COMPONENTS ${sdl_name_component} SDL3_test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(TARGET sdl-build-options)
|
||||||
|
set(SDL3_TESTS_SUBPROJECT ON)
|
||||||
|
else()
|
||||||
|
set(SDL3_TESTS_SUBPROJECT OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
# CMake incorrectly detects opengl32.lib being present on MSVC ARM64
|
# CMake incorrectly detects opengl32.lib being present on MSVC ARM64
|
||||||
if(NOT MSVC OR NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
|
if(NOT MSVC OR NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
|
||||||
# Prefer GLVND, if present
|
# Prefer GLVND, if present
|
||||||
|
@ -115,6 +121,13 @@ macro(add_sdl_test_executable TARGET)
|
||||||
if(TARGET sdl-global-options)
|
if(TARGET sdl-global-options)
|
||||||
target_link_libraries(${TARGET} PRIVATE $<BUILD_INTERFACE:sdl-global-options>)
|
target_link_libraries(${TARGET} PRIVATE $<BUILD_INTERFACE:sdl-global-options>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SDL3_TESTS_SUBPROJECT)
|
||||||
|
# FIXME: only add "${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>" + include paths of external dependencies
|
||||||
|
target_include_directories(${TARGET} PRIVATE "$<TARGET_PROPERTY:SDL3::${sdl_name_component},INCLUDE_DIRECTORIES>")
|
||||||
|
else()
|
||||||
|
target_include_directories(${TARGET} PRIVATE "../include")
|
||||||
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
check_include_file(signal.h HAVE_SIGNAL_H)
|
check_include_file(signal.h HAVE_SIGNAL_H)
|
||||||
|
@ -149,7 +162,7 @@ add_sdl_test_executable(testdrawchessboard SOURCES testdrawchessboard.c)
|
||||||
add_sdl_test_executable(testdropfile SOURCES testdropfile.c)
|
add_sdl_test_executable(testdropfile SOURCES testdropfile.c)
|
||||||
add_sdl_test_executable(testerror NONINTERACTIVE SOURCES testerror.c)
|
add_sdl_test_executable(testerror NONINTERACTIVE SOURCES testerror.c)
|
||||||
|
|
||||||
if(LINUX AND TARGET sdl-build-options)
|
if(LINUX AND SDL3_TESTS_SUBPROJECT)
|
||||||
set(build_options_dependent_tests )
|
set(build_options_dependent_tests )
|
||||||
|
|
||||||
add_sdl_test_executable(testevdev NONINTERACTIVE SOURCES testevdev.c)
|
add_sdl_test_executable(testevdev NONINTERACTIVE SOURCES testevdev.c)
|
||||||
|
@ -258,10 +271,6 @@ if(HAVE_WFORMAT_EXTRA_ARGS)
|
||||||
target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT_EXTRA_ARGS)
|
target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT_EXTRA_ARGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT HAVE_X11)
|
|
||||||
target_compile_definitions(testautomation PRIVATE SDL_DISABLE_SYSWM_X11)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(SDL_DUMMYAUDIO)
|
if(SDL_DUMMYAUDIO)
|
||||||
set_property(TARGET testaudioinfo PROPERTY SDL_NONINTERACTIVE 1)
|
set_property(TARGET testaudioinfo PROPERTY SDL_NONINTERACTIVE 1)
|
||||||
set_property(TARGET testsurround PROPERTY SDL_NONINTERACTIVE 1)
|
set_property(TARGET testsurround PROPERTY SDL_NONINTERACTIVE 1)
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
/**
|
/**
|
||||||
* Intrinsics test suite
|
* Intrinsics test suite
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Disable intrinsics that are unsupported by the current compiler */
|
||||||
|
#include <build_config/SDL_build_config.h>
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <SDL3/SDL_intrin.h>
|
#include <SDL3/SDL_intrin.h>
|
||||||
#include <SDL3/SDL_test.h>
|
#include <SDL3/SDL_test.h>
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
/**
|
/**
|
||||||
* SysWM test suite
|
* SysWM test suite
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Avoid inclusion of e.g. X11 headers when these are not installed */
|
||||||
|
#include <build_config/SDL_build_config.h>
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <SDL3/SDL_syswm.h>
|
#include <SDL3/SDL_syswm.h>
|
||||||
#include <SDL3/SDL_test.h>
|
#include <SDL3/SDL_test.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue