From 30f41c02aec763d32e62351452da9ef582bc3472 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 6 Mar 2026 13:30:59 -0800 Subject: Move contrib libraries to contrib repo --- contrib/SDL-3.2.8/cmake/test/CMakeLists.txt | 135 --------------------- contrib/SDL-3.2.8/cmake/test/inc_sdl_slash.c | 8 -- contrib/SDL-3.2.8/cmake/test/main.swift | 13 -- contrib/SDL-3.2.8/cmake/test/main_cli.c | 15 --- contrib/SDL-3.2.8/cmake/test/main_gui.c | 24 ---- contrib/SDL-3.2.8/cmake/test/main_lib.c | 34 ------ contrib/SDL-3.2.8/cmake/test/sdltest.c | 9 -- .../SDL-3.2.8/cmake/test/swift/module.modulemap | 4 - contrib/SDL-3.2.8/cmake/test/swift/shim.h | 3 - contrib/SDL-3.2.8/cmake/test/test_pkgconfig.sh | 51 -------- 10 files changed, 296 deletions(-) delete mode 100644 contrib/SDL-3.2.8/cmake/test/CMakeLists.txt delete mode 100644 contrib/SDL-3.2.8/cmake/test/inc_sdl_slash.c delete mode 100644 contrib/SDL-3.2.8/cmake/test/main.swift delete mode 100644 contrib/SDL-3.2.8/cmake/test/main_cli.c delete mode 100644 contrib/SDL-3.2.8/cmake/test/main_gui.c delete mode 100644 contrib/SDL-3.2.8/cmake/test/main_lib.c delete mode 100644 contrib/SDL-3.2.8/cmake/test/sdltest.c delete mode 100644 contrib/SDL-3.2.8/cmake/test/swift/module.modulemap delete mode 100644 contrib/SDL-3.2.8/cmake/test/swift/shim.h delete mode 100755 contrib/SDL-3.2.8/cmake/test/test_pkgconfig.sh (limited to 'contrib/SDL-3.2.8/cmake/test') diff --git a/contrib/SDL-3.2.8/cmake/test/CMakeLists.txt b/contrib/SDL-3.2.8/cmake/test/CMakeLists.txt deleted file mode 100644 index e3766f0..0000000 --- a/contrib/SDL-3.2.8/cmake/test/CMakeLists.txt +++ /dev/null @@ -1,135 +0,0 @@ -# This cmake build script is meant for verifying the various CMake configuration scripts. - -cmake_minimum_required(VERSION 3.12) -project(SDL_cmake_selftest LANGUAGES C) - -include(CheckLanguage) - -# FIXME: how to target ios/tvos with Swift? -# https://gitlab.kitware.com/cmake/cmake/-/issues/20104 -if(APPLE AND CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*") - # multiple values for CMAKE_OSX_ARCHITECTURES not supported with Swift - list(LENGTH CMAKE_OSX_ARCHITECTURES count_osx_archs) - if(count_osx_archs LESS_EQUAL 1) - check_language(Swift) - if(CMAKE_Swift_COMPILER) - enable_language(Swift) - endif() - endif() -endif() - -message(STATUS "CMAKE_SYSTEM_NAME= ${CMAKE_SYSTEM_NAME}") -message(STATUS "CMAKE_SYSTEM_PROCESSOR= ${CMAKE_SYSTEM_PROCESSOR}") - -include(GenerateExportHeader) - -if(ANDROID) - macro(add_executable NAME) - set(args ${ARGN}) - list(REMOVE_ITEM args WIN32) - add_library(${NAME} SHARED ${args}) - unset(args) - endmacro() -endif() - -cmake_policy(SET CMP0074 NEW) - -# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL3 outside of sysroot -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) - -include(FeatureSummary) - -option(TEST_SHARED "Test linking to shared SDL3 library" ON) -add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library") - -option(TEST_STATIC "Test linking to static SDL3 library" ON) -add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library") - -option(TEST_TEST "Test linking to SDL3_test library" ON) -add_feature_info("TEST_TEST" TEST_STATIC "Test linking to SDL test library") - -option(TEST_FULL "Run complete SDL test suite" OFF) -add_feature_info("TEST_FULL" TEST_FULL "Build full SDL testsuite") - -find_package(SDL3 REQUIRED CONFIG COMPONENTS Headers) -add_library(headers_test_slash OBJECT inc_sdl_slash.c) -target_link_libraries(headers_test_slash PRIVATE SDL3::Headers) - -if(TEST_SHARED) - find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3-shared) - add_executable(gui-shared WIN32 main_gui.c) - target_link_libraries(gui-shared PRIVATE SDL3::SDL3-shared) - if(WIN32) - add_custom_command(TARGET gui-shared POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" - ) - endif() - - add_library(sharedlib-shared SHARED main_lib.c) - target_link_libraries(sharedlib-shared PRIVATE SDL3::SDL3-shared) - generate_export_header(sharedlib-shared EXPORT_MACRO_NAME MYLIBRARY_EXPORT) - target_compile_definitions(sharedlib-shared PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-shared_export.h\"") - set_target_properties(sharedlib-shared PROPERTIES C_VISIBILITY_PRESET "hidden") - - add_executable(cli-shared main_cli.c) - target_link_libraries(cli-shared PRIVATE SDL3::SDL3-shared) - if(WIN32) - add_custom_command(TARGET cli-shared POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" - ) - endif() - - if(TEST_TEST) - add_executable(sdltest-shared sdltest.c) - target_link_libraries(sdltest-shared PRIVATE SDL3::SDL3_test SDL3::SDL3-shared) - endif() - - if(CMAKE_Swift_COMPILER) - add_executable(swift-shared main.swift) - target_include_directories(swift-shared PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift") - target_link_libraries(swift-shared PRIVATE SDL3::SDL3-shared) - endif() -endif() - -if(TEST_STATIC) - find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3-static) - add_executable(gui-static WIN32 main_gui.c) - target_link_libraries(gui-static PRIVATE SDL3::SDL3-static) - - # Assume SDL library has been built with `set(CMAKE_POSITION_INDEPENDENT_CODE ON)` - add_library(sharedlib-static SHARED main_lib.c) - target_link_libraries(sharedlib-static PRIVATE SDL3::SDL3-static) - generate_export_header(sharedlib-static EXPORT_MACRO_NAME MYLIBRARY_EXPORT) - target_compile_definitions(sharedlib-static PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-static_export.h\"") - set_target_properties(sharedlib-static PROPERTIES C_VISIBILITY_PRESET "hidden") - - if(TEST_TEST) - add_executable(sdltest-static sdltest.c) - target_link_libraries(sdltest-static PRIVATE SDL3::SDL3_test SDL3::SDL3-static) - endif() - - if(CMAKE_Swift_COMPILER) - add_executable(swift-static main.swift) - target_include_directories(swift-static PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift") - target_link_libraries(swift-static PRIVATE SDL3::SDL3-static) - endif() -endif() - -find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3) -add_executable(gui-whatever WIN32 main_gui.c) -target_link_libraries(gui-whatever PRIVATE SDL3::SDL3) - -if(TEST_FULL) - enable_testing() - set(SDL_TESTS_TIMEOUT_MULTIPLIER "1" CACHE STRING "Test timeout multiplier") - set(SDL_TESTS_LINK_SHARED ${TEST_SHARED}) - - add_definitions(-DNO_BUILD_CONFIG) - add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../../test" SDL_test) -endif() - -if(ANDROID) - find_package(SDL3 REQUIRED CONFIG COMPONENTS Jar) -endif() - -feature_summary(WHAT ALL) diff --git a/contrib/SDL-3.2.8/cmake/test/inc_sdl_slash.c b/contrib/SDL-3.2.8/cmake/test/inc_sdl_slash.c deleted file mode 100644 index 7acca15..0000000 --- a/contrib/SDL-3.2.8/cmake/test/inc_sdl_slash.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "SDL3/SDL.h" -#include "SDL3/SDL_main.h" - -void inc_sdl_slash(void) { - SDL_SetMainReady(); - SDL_Init(0); - SDL_Quit(); -} diff --git a/contrib/SDL-3.2.8/cmake/test/main.swift b/contrib/SDL-3.2.8/cmake/test/main.swift deleted file mode 100644 index 1943f7c..0000000 --- a/contrib/SDL-3.2.8/cmake/test/main.swift +++ /dev/null @@ -1,13 +0,0 @@ -/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */ - -import SDL3 - -guard SDL_Init(SDL_INIT_VIDEO) else { - fatalError("SDL_Init error: \(String(cString: SDL_GetError()))") -} - -var sdlVersion = SDL_GetVersion() - -print("SDL version: \(sdlVersion)") - -SDL_Quit() diff --git a/contrib/SDL-3.2.8/cmake/test/main_cli.c b/contrib/SDL-3.2.8/cmake/test/main_cli.c deleted file mode 100644 index 39c5ce2..0000000 --- a/contrib/SDL-3.2.8/cmake/test/main_cli.c +++ /dev/null @@ -1,15 +0,0 @@ -#define SDL_MAIN_HANDLED -#include -#include - -int main(int argc, char *argv[]) -{ - SDL_SetMainReady(); - if (!SDL_Init(0)) { - SDL_Log("Could not initialize SDL: %s", SDL_GetError()); - return 1; - } - SDL_Delay(100); - SDL_Quit(); - return 0; -} diff --git a/contrib/SDL-3.2.8/cmake/test/main_gui.c b/contrib/SDL-3.2.8/cmake/test/main_gui.c deleted file mode 100644 index 18ed101..0000000 --- a/contrib/SDL-3.2.8/cmake/test/main_gui.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - SDL_Window *window = NULL; - SDL_Surface *screenSurface = NULL; - if (!SDL_Init(SDL_INIT_VIDEO)) { - SDL_Log("Could not initialize SDL: %s", SDL_GetError()); - return 1; - } - window = SDL_CreateWindow("Hello SDL", 640, 480, 0); - if (!window) { - SDL_Log("could not create window: %s", SDL_GetError()); - return 1; - } - screenSurface = SDL_GetWindowSurface(window); - SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapSurfaceRGB(screenSurface, 0xff, 0xff, 0xff)); - SDL_UpdateWindowSurface(window); - SDL_Delay(100); - SDL_DestroyWindow(window); - SDL_Quit(); - return 0; -} diff --git a/contrib/SDL-3.2.8/cmake/test/main_lib.c b/contrib/SDL-3.2.8/cmake/test/main_lib.c deleted file mode 100644 index 6aec1f6..0000000 --- a/contrib/SDL-3.2.8/cmake/test/main_lib.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */ -#include - -#include EXPORT_HEADER - -#ifdef _WIN32 -#include -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - return TRUE; -} -#endif - -int MYLIBRARY_EXPORT mylibrary_init(void); -void MYLIBRARY_EXPORT mylibrary_quit(void); -int MYLIBRARY_EXPORT mylibrary_work(void); - -int mylibrary_init(void) { - SDL_SetMainReady(); - if (!SDL_Init(0)) { - SDL_Log("Could not initialize SDL: %s", SDL_GetError()); - return 1; - } - return 0; -} - -void mylibrary_quit(void) { - SDL_Quit(); -} - -int mylibrary_work(void) { - SDL_Delay(100); - return 0; -} diff --git a/contrib/SDL-3.2.8/cmake/test/sdltest.c b/contrib/SDL-3.2.8/cmake/test/sdltest.c deleted file mode 100644 index f598a98..0000000 --- a/contrib/SDL-3.2.8/cmake/test/sdltest.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - - -int main(int argc, char *argv[]) { - SDLTest_CommonState state; - SDLTest_CommonDefaultArgs(&state, argc, argv); - return 0; -} diff --git a/contrib/SDL-3.2.8/cmake/test/swift/module.modulemap b/contrib/SDL-3.2.8/cmake/test/swift/module.modulemap deleted file mode 100644 index bbc26a9..0000000 --- a/contrib/SDL-3.2.8/cmake/test/swift/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module SDL3 [extern_c] { - header "shim.h" - export * -} diff --git a/contrib/SDL-3.2.8/cmake/test/swift/shim.h b/contrib/SDL-3.2.8/cmake/test/swift/shim.h deleted file mode 100644 index dba8c6f..0000000 --- a/contrib/SDL-3.2.8/cmake/test/swift/shim.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */ - -#include diff --git a/contrib/SDL-3.2.8/cmake/test/test_pkgconfig.sh b/contrib/SDL-3.2.8/cmake/test/test_pkgconfig.sh deleted file mode 100755 index 5bb84df..0000000 --- a/contrib/SDL-3.2.8/cmake/test/test_pkgconfig.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -if test "x$CC" = "x"; then - CC=cc -fi - -machine="$($CC -dumpmachine)" -case "$machine" in - *mingw* ) - EXEPREFIX="" - EXESUFFIX=".exe" - ;; - *android* ) - EXEPREFIX="lib" - EXESUFFIX=".so" - LDFLAGS="$EXTRA_LDFLAGS -shared" - ;; - * ) - EXEPREFIX="" - EXESUFFIX="" - ;; -esac - -set -e - -# Get the canonical path of the folder containing this script -testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") -SDL_CFLAGS="$( pkg-config sdl3 --cflags )" -SDL_LDFLAGS="$( pkg-config sdl3 --libs )" -SDL_STATIC_LDFLAGS="$( pkg-config sdl3 --libs --static )" - -compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS" -link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS" -static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS" - -echo "-- CC: $CC" -echo "-- CFLAGS: $CFLAGS" -echo "-- LDFLASG: $LDFLAGS" -echo "-- SDL_CFLAGS: $SDL_CFLAGS" -echo "-- SDL_LDFLAGS: $SDL_LDFLAGS" -echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS" - -echo "-- COMPILE: $compile_cmd" -echo "-- LINK: $link_cmd" -echo "-- STATIC_LINK: $static_link_cmd" - -set -x - -$compile_cmd -$link_cmd -$static_link_cmd -- cgit v1.2.3