cmake: include directories of (generated) dependencies as SYSTEM
parent
a9650d440a
commit
cc0fa00049
|
@ -269,7 +269,7 @@ endif()
|
||||||
|
|
||||||
if(CYGWIN)
|
if(CYGWIN)
|
||||||
# We build SDL on cygwin without the UNIX emulation layer
|
# We build SDL on cygwin without the UNIX emulation layer
|
||||||
target_include_directories(sdl-build-options INTERFACE "/usr/include/mingw")
|
target_include_directories(sdl-build-options SYSTEM INTERFACE "/usr/include/mingw")
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mno-cygwin")
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mno-cygwin")
|
||||||
check_c_source_compiles("int main(int argc, char **argv) { return 0; }"
|
check_c_source_compiles("int main(int argc, char **argv) { return 0; }"
|
||||||
|
@ -297,7 +297,7 @@ if(USE_GCC OR (USE_CLANG AND NOT MSVC_CLANG))
|
||||||
target_compile_options(sdl-global-options INTERFACE "SHELL:-idirafter \"${SDL3_SOURCE_DIR}/src/video/khronos\"")
|
target_compile_options(sdl-global-options INTERFACE "SHELL:-idirafter \"${SDL3_SOURCE_DIR}/src/video/khronos\"")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
target_include_directories(sdl-global-options INTERFACE "${SDL3_SOURCE_DIR}/src/video/khronos")
|
target_include_directories(sdl-global-options SYSTEM INTERFACE "${SDL3_SOURCE_DIR}/src/video/khronos")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
|
# All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
|
||||||
|
@ -1494,7 +1494,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||||
pkg_search_module(DBUS dbus-1 dbus)
|
pkg_search_module(DBUS dbus-1 dbus)
|
||||||
if(DBUS_FOUND)
|
if(DBUS_FOUND)
|
||||||
set(HAVE_DBUS_DBUS_H TRUE)
|
set(HAVE_DBUS_DBUS_H TRUE)
|
||||||
target_include_directories(sdl-build-options INTERFACE ${DBUS_INCLUDE_DIRS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${DBUS_INCLUDE_DIRS})
|
||||||
# Fcitx need only dbus.
|
# Fcitx need only dbus.
|
||||||
set(HAVE_FCITX TRUE)
|
set(HAVE_FCITX TRUE)
|
||||||
set(HAVE_DBUS TRUE)
|
set(HAVE_DBUS TRUE)
|
||||||
|
@ -1506,7 +1506,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||||
find_path(HAVE_SYS_INOTIFY_H NAMES sys/inotify.h)
|
find_path(HAVE_SYS_INOTIFY_H NAMES sys/inotify.h)
|
||||||
if(IBUS_FOUND AND HAVE_SYS_INOTIFY_H)
|
if(IBUS_FOUND AND HAVE_SYS_INOTIFY_H)
|
||||||
set(HAVE_IBUS_IBUS_H TRUE)
|
set(HAVE_IBUS_IBUS_H TRUE)
|
||||||
target_include_directories(sdl-build-options INTERFACE ${IBUS_INCLUDE_DIRS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${IBUS_INCLUDE_DIRS})
|
||||||
set(HAVE_IBUS TRUE)
|
set(HAVE_IBUS TRUE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -1519,7 +1519,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
||||||
pkg_search_module(INOTIFY libinotify)
|
pkg_search_module(INOTIFY libinotify)
|
||||||
if(INOTIFY_FOUND)
|
if(INOTIFY_FOUND)
|
||||||
set(HAVE_INOTIFY 1)
|
set(HAVE_INOTIFY 1)
|
||||||
target_include_directories(sdl-build-options INTERFACE ${INOTIFY_INCLUDE_DIRS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${INOTIFY_INCLUDE_DIRS})
|
||||||
list(APPEND SDL_EXTRA_LIBS ${INOTIFY_LIBRARIES})
|
list(APPEND SDL_EXTRA_LIBS ${INOTIFY_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -3092,7 +3092,7 @@ if(WARN_ABOUT_ARM_NEON_ASM_MIT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures")
|
target_include_directories(sdl-build-options SYSTEM INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
|
|
@ -137,7 +137,7 @@ macro(CheckPipewire)
|
||||||
file(GLOB PIPEWIRE_SOURCES ${SDL3_SOURCE_DIR}/src/audio/pipewire/*.c)
|
file(GLOB PIPEWIRE_SOURCES ${SDL3_SOURCE_DIR}/src/audio/pipewire/*.c)
|
||||||
list(APPEND SOURCE_FILES ${PIPEWIRE_SOURCES})
|
list(APPEND SOURCE_FILES ${PIPEWIRE_SOURCES})
|
||||||
set(SDL_AUDIO_DRIVER_PIPEWIRE 1)
|
set(SDL_AUDIO_DRIVER_PIPEWIRE 1)
|
||||||
target_compile_options(sdl-build-options INTERFACE ${PKG_PIPEWIRE_CFLAGS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${PKG_PIPEWIRE_INCLUDE_DIRS})
|
||||||
if(SDL_PIPEWIRE_SHARED AND NOT HAVE_SDL_LOADSO)
|
if(SDL_PIPEWIRE_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||||
message_warn("You must have SDL_LoadObject() support for dynamic Pipewire loading")
|
message_warn("You must have SDL_LoadObject() support for dynamic Pipewire loading")
|
||||||
endif()
|
endif()
|
||||||
|
@ -166,7 +166,7 @@ macro(CheckPulseAudio)
|
||||||
file(GLOB PULSEAUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/pulseaudio/*.c)
|
file(GLOB PULSEAUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/pulseaudio/*.c)
|
||||||
list(APPEND SOURCE_FILES ${PULSEAUDIO_SOURCES})
|
list(APPEND SOURCE_FILES ${PULSEAUDIO_SOURCES})
|
||||||
set(SDL_AUDIO_DRIVER_PULSEAUDIO 1)
|
set(SDL_AUDIO_DRIVER_PULSEAUDIO 1)
|
||||||
target_compile_options(sdl-build-options INTERFACE ${PKG_PULSEAUDIO_CFLAGS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${PKG_PULSEAUDIO_INCLUDE_DIRS})
|
||||||
if(SDL_PULSEAUDIO_SHARED AND NOT HAVE_SDL_LOADSO)
|
if(SDL_PULSEAUDIO_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||||
message_warn("You must have SDL_LoadObject() support for dynamic PulseAudio loading")
|
message_warn("You must have SDL_LoadObject() support for dynamic PulseAudio loading")
|
||||||
endif()
|
endif()
|
||||||
|
@ -195,7 +195,7 @@ macro(CheckJACK)
|
||||||
file(GLOB JACK_SOURCES ${SDL3_SOURCE_DIR}/src/audio/jack/*.c)
|
file(GLOB JACK_SOURCES ${SDL3_SOURCE_DIR}/src/audio/jack/*.c)
|
||||||
list(APPEND SOURCE_FILES ${JACK_SOURCES})
|
list(APPEND SOURCE_FILES ${JACK_SOURCES})
|
||||||
set(SDL_AUDIO_DRIVER_JACK 1)
|
set(SDL_AUDIO_DRIVER_JACK 1)
|
||||||
target_compile_options(sdl-build-options INTERFACE ${PKG_JACK_CFLAGS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${PKG_JACK_INCLUDE_DIRS})
|
||||||
if(SDL_JACK_SHARED AND NOT HAVE_SDL_LOADSO)
|
if(SDL_JACK_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||||
message_warn("You must have SDL_LoadObject() support for dynamic JACK audio loading")
|
message_warn("You must have SDL_LoadObject() support for dynamic JACK audio loading")
|
||||||
endif()
|
endif()
|
||||||
|
@ -224,7 +224,7 @@ macro(CheckSNDIO)
|
||||||
file(GLOB SNDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sndio/*.c)
|
file(GLOB SNDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sndio/*.c)
|
||||||
list(APPEND SOURCE_FILES ${SNDIO_SOURCES})
|
list(APPEND SOURCE_FILES ${SNDIO_SOURCES})
|
||||||
set(SDL_AUDIO_DRIVER_SNDIO 1)
|
set(SDL_AUDIO_DRIVER_SNDIO 1)
|
||||||
target_compile_options(sdl-build-options INTERFACE ${PKG_SNDIO_CFLAGS})
|
target_include_directories(sdl-build-options INTERFACE ${PKG_SNDIO_INCLUDE_DIRS})
|
||||||
if(SDL_SNDIO_SHARED AND NOT HAVE_SDL_LOADSO)
|
if(SDL_SNDIO_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||||
message_warn("You must have SDL_LoadObject() support for dynamic sndio loading")
|
message_warn("You must have SDL_LoadObject() support for dynamic sndio loading")
|
||||||
endif()
|
endif()
|
||||||
|
@ -570,7 +570,7 @@ macro(CheckWayland)
|
||||||
|
|
||||||
# We have to generate some protocol interface code for some unstable Wayland features.
|
# We have to generate some protocol interface code for some unstable Wayland features.
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
|
||||||
target_include_directories(sdl-build-options INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
|
target_include_directories(sdl-build-options SYSTEM INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
|
||||||
|
|
||||||
file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL3_SOURCE_DIR}/wayland-protocols/" "${SDL3_SOURCE_DIR}/wayland-protocols/*.xml")
|
file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL3_SOURCE_DIR}/wayland-protocols/" "${SDL3_SOURCE_DIR}/wayland-protocols/*.xml")
|
||||||
foreach(_XML ${WAYLAND_PROTOCOLS_XML})
|
foreach(_XML ${WAYLAND_PROTOCOLS_XML})
|
||||||
|
@ -606,7 +606,7 @@ macro(CheckWayland)
|
||||||
set(HAVE_WAYLAND_LIBDECOR TRUE)
|
set(HAVE_WAYLAND_LIBDECOR TRUE)
|
||||||
set(HAVE_LIBDECOR_H 1)
|
set(HAVE_LIBDECOR_H 1)
|
||||||
target_link_directories(sdl-build-options INTERFACE "${PKG_LIBDECOR_LIBRARY_DIRS}")
|
target_link_directories(sdl-build-options INTERFACE "${PKG_LIBDECOR_LIBRARY_DIRS}")
|
||||||
target_include_directories(sdl-build-options INTERFACE "${PKG_LIBDECOR_INCLUDE_DIRS}")
|
target_include_directories(sdl-build-options SYSTEM INTERFACE "${PKG_LIBDECOR_INCLUDE_DIRS}")
|
||||||
if(SDL_WAYLAND_LIBDECOR_SHARED AND NOT HAVE_SDL_LOADSO)
|
if(SDL_WAYLAND_LIBDECOR_SHARED AND NOT HAVE_SDL_LOADSO)
|
||||||
message_warn("You must have SDL_LoadObject() support for dynamic libdecor loading")
|
message_warn("You must have SDL_LoadObject() support for dynamic libdecor loading")
|
||||||
endif()
|
endif()
|
||||||
|
@ -1050,7 +1050,7 @@ macro(CheckHIDAPI)
|
||||||
check_include_file(libusb.h HAVE_LIBUSB_H ${PKG_LIBUSB_CFLAGS})
|
check_include_file(libusb.h HAVE_LIBUSB_H ${PKG_LIBUSB_CFLAGS})
|
||||||
if(HAVE_LIBUSB_H)
|
if(HAVE_LIBUSB_H)
|
||||||
set(HAVE_LIBUSB TRUE)
|
set(HAVE_LIBUSB TRUE)
|
||||||
target_compile_options(sdl-build-options INTERFACE ${PKG_LIBUSB_CFLAGS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${PKG_LIBUSB_INCLUDE_DIRS})
|
||||||
if(HIDAPI_ONLY_LIBUSB)
|
if(HIDAPI_ONLY_LIBUSB)
|
||||||
list(APPEND SDL_EXTRA_LIBS ${PKG_LIBUSB_LIBRARIES})
|
list(APPEND SDL_EXTRA_LIBS ${PKG_LIBUSB_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
|
@ -1166,7 +1166,7 @@ macro(CheckKMSDRM)
|
||||||
file(GLOB KMSDRM_SOURCES ${SDL3_SOURCE_DIR}/src/video/kmsdrm/*.c)
|
file(GLOB KMSDRM_SOURCES ${SDL3_SOURCE_DIR}/src/video/kmsdrm/*.c)
|
||||||
list(APPEND SOURCE_FILES ${KMSDRM_SOURCES})
|
list(APPEND SOURCE_FILES ${KMSDRM_SOURCES})
|
||||||
|
|
||||||
target_compile_options(sdl-build-options INTERFACE ${PKG_KMSDRM_CFLAGS})
|
target_include_directories(sdl-build-options SYSTEM INTERFACE ${PKG_KMSDRM_INCLUDE_DIRS})
|
||||||
|
|
||||||
set(SDL_VIDEO_DRIVER_KMSDRM 1)
|
set(SDL_VIDEO_DRIVER_KMSDRM 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue