Compare commits

...

10 Commits

Author SHA1 Message Date
Xavier Del Campo Romero 5829ef82c4 Use find_package for SDL libraries
CMake already distributes FindSDL*.cmake files for SDL and SDL_mixer,
which support custom prefixes via environment variables, removing the
need for ad-hoc logic in Win9x builds.

Also, according to FindSDL.cmake, #include <SDL.h> is the preferred way
for portability reasons, instead of #include <SDL/SDL.h>, which is the
option that has been used so far.
2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero 37ee2c11f3 ps1.cmake: import PSXSDK using find_package 2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero 538a03f160 README.md: Update documentation for Win9x builds 2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero f9e46c950f ps1: Use exported target PSXSDK::PSXSDK 2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero 127a21a34f Implement FindPSXSDK.cmake 2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero 8f3403dffa Update FindSDL_gfx.cmake as of today's upstream
Ongoing PR:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7475
2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero c37cd892a0 system/CMakeLists.txt: group common private dependencies into var 2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero 79c0164c21 Create cdroot directory on common CMakeLists.txt 2022-07-23 04:23:05 +02:00
Xavier Del Campo Romero 7a6f5cd2e6 README.md: Document dependencies for Ubuntu builds 2022-07-23 04:16:57 +02:00
Xavier Del Campo Romero 6b46057728 CMakeLists.txt: Define rts as a C-only project
While it is true "extern C" is used on all headers, there is no need for
CMake to check the C++ compiler.
2022-07-23 04:16:57 +02:00
24 changed files with 197 additions and 108 deletions

View File

@ -7,19 +7,35 @@ ExternalProject_Add(tools
CMAKE_ARGS
-D CMAKE_INSTALL_PREFIX=${TOOLS_PREFIX})
project(rts)
project(rts C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
if(CMAKE_TOOLCHAIN_FILE MATCHES "ps1")
set(PS1_BUILD 1)
elseif(CMAKE_TOOLCHAIN_FILE MATCHES "win9x")
set(WIN9X_BUILD 1)
set(SDL1_2_BUILD 1)
else()
set(HOST_BUILD 1)
set(SDL1_2_BUILD 1)
endif()
add_executable(${PROJECT_NAME} "src/main.c")
if(SDL1_2_BUILD)
find_package(SDL 1.2 REQUIRED)
find_package(SDL_gfx 2.0 REQUIRED)
find_package(SDL_mixer 1.2 REQUIRED)
# FindSDL_mixer.cmake does not export any target, so do it here instead.
add_library(SDL::SDL_mixer STATIC IMPORTED)
set_property(TARGET SDL::SDL_mixer PROPERTY
IMPORTED_LOCATION ${SDL_MIXER_LIBRARIES})
target_include_directories(SDL::SDL_mixer INTERFACE ${SDL_MIXER_INCLUDE_DIRS})
target_link_libraries(SDL::SDL_mixer INTERFACE SDL::SDL)
endif()
set(cdroot ${CMAKE_BINARY_DIR}/cdimg)
file(MAKE_DIRECTORY ${cdroot})
# Avoid C11 since it is not supported by the i386-mingw32 toolchain.
set(cflags -Wall -g3 -ffunction-sections -fdata-sections -pedantic -std=c99)

View File

@ -52,6 +52,14 @@ cmake ..
make -j$(nproc --all)
```
#### Dependencies
##### Ubuntu
```sh
apt install libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl1.2-dev
```
### Cross-compilation
[`CMAKE_TOOLCHAIN_FILE`](https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html)
@ -80,13 +88,42 @@ on real hardware.
```sh
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/win9x-toolchain.cmake
SDLDIR=<sdl-prefix> \
SDLMIXERDIR=<sdl_mixer-prefix> \
SDLGFXDIR=<sdl_gfx-prefix> \
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/win9x-toolchain.cmake
make -j$(nproc --all)
```
Where:
- `SDLDIR` is the path to the cross-compiled version for `SDL-1.2`, which
would correspond to `./configure --prefix=$SDLDIR` used when building
`SDL-1.2`.
- `SDLMIXERDIR` is the path to the cross-compiled version for `SDL_mixer`,
which would correspond to `./configure --prefix=$SDLMIXERDIR` used in
building `SDL_mixer`.
- `SDLGFXDIR` is the path to the cross-compiled version for `SDL_gfx`,
which would correspond to `./configure --prefix=$SDLGFXDIR` used in
building `SDL_gfx`.
A stripped version of the executable, as well as game assets, will be
located in `build/cdimg`.
#### Dependencies
A cross-compiled `i386-mingw32` version of all required dependencies
is needed before building `rts`.
Note upstream CMake does not provide `FindSDL_gfx.cmake` as of the time
of this writing, so it is provisionally provided on
[this repository](cmake/FindSDL_gfx.cmake).
[Ongoing upstream PR](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7475)
Read [the documentation](doc/BUILD-win9x.md) for further reference on
how to build the dependencies from source.
## License
Unless stated otherwise, **RTS** follows the license described by the

94
cmake/FindPSXSDK.cmake Normal file
View File

@ -0,0 +1,94 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPSXSDK
-----------
Find PSXSDK (an open source software development kit for the original
Sony PlayStation) libraries and header files.
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``PSXSDK::PSXSDK``,
The PSXSDK `psx` library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``PSXSDK_FOUND``
true if PSXSDK libraries and header files were found.
``PSXSDK_VERSION``
PSXSDK release version
``PSXSDK_INCLUDE_DIRS``
the directory containing the PSXSDK headers; note
``PSXSDK_INCLUDE_DIRS`` is also required
``PSXSDK_LIBRARIES``
PSXSDK libraries to be linked; note ``PSXSDK_LIBRARIES`` is also
required
#]=======================================================================]
find_path(PSXSDK_INCLUDE_DIRS
NAMES
huff.h
meidogte.h
meidogte_inline.h
memcard.h
modplay.h
psxbios.h
psxcdrom.h
psxgpu.h
psxgte.h
psx.h
psxpad.h
psxsio.h
psxspu.h
psxutil.h
runexe.h
search.h
HINTS
ENV PSXSDK_PATH
PATH_SUFFIXES
include
)
find_library(PSXSDK_LIBRARIES
NAMES psx
HINTS
ENV PSXSDK_PATH
PATH_SUFFIXES
lib
)
if(PSXSDK_INCLUDE_DIRS AND EXISTS "${PSXSDK_INCLUDE_DIRS}/psx.h")
set(version_regex "^#define[ \t]+PSXSDK_VERSION_STRING[ \t]+\"([0-9\.]+)\"$")
file(STRINGS "${PSXSDK_INCLUDE_DIRS}/psx.h" PSXSDK_VERSION_LINE REGEX ${version_regex})
string(REGEX REPLACE ${version_regex} "\\1" PSXSDK_VERSION "${PSXSDK_VERSION_LINE}")
unset(PSXSDK_VERSION_LINE)
unset(version_regex)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PSXSDK
REQUIRED_VARS
PSXSDK_LIBRARIES PSXSDK_INCLUDE_DIRS
VERSION_VAR
PSXSDK_VERSION
)
if(PSXSDK_FOUND)
if(NOT TARGET PSXSDK::PSXSDK)
add_library(PSXSDK::PSXSDK INTERFACE IMPORTED)
target_include_directories(PSXSDK::PSXSDK
INTERFACE "${PSXSDK_INCLUDE_DIRS}")
set_target_properties(PSXSDK::PSXSDK PROPERTIES
IMPORTED_LOCATION "${PSXSDK_LIBRARIES}")
endif()
endif()

View File

@ -3,7 +3,7 @@
#[=======================================================================[.rst:
FindSDL_gfx
-------------
-----------
Locate SDL_gfx library
@ -11,36 +11,19 @@ This module defines:
::
SDL::SDL_gfx, the name of the target to use with target_*() commands
SDL_GFX_LIBRARIES, the name of the library to link against
SDL_GFX_INCLUDE_DIRS, where to find the headers
SDL_GFX_FOUND, if false, do not try to link against
SDL_GFX_VERSION_STRING - human-readable string containing the
version of SDL_gfx
For backward compatibility the following variables are also set:
::
SDLGFX_LIBRARY (same value as SDL_GFX_LIBRARIES)
SDLGFX_INCLUDE_DIR (same value as SDL_GFX_INCLUDE_DIRS)
SDLGFX_FOUND (same value as SDL_GFX_FOUND)
$SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL.
Created by Xavier Del Campo, heavily based on the original work by
Eric Wing, FindSDL_mixer.cmake.
#]=======================================================================]
if(NOT SDL_GFX_INCLUDE_DIR AND SDLGFX_INCLUDE_DIR)
set(SDL_GFX_INCLUDE_DIR ${SDLGFX_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL_GFX_INCLUDE_DIR
find_path(SDL_GFX_INCLUDE_DIRS
NAMES
SDL_framerate.h
SDL_gfxBlitFunc.h
SDL_gfxPrimitives.h
@ -61,11 +44,7 @@ else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL_GFX_LIBRARY AND SDLGFX_LIBRARY)
set(SDL_GFX_LIBRARY ${SDLGFX_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL_GFX_LIBRARY
find_library(SDL_GFX_LIBRARIES
NAMES SDL_gfx
HINTS
ENV SDLGFXDIR
@ -73,10 +52,10 @@ find_library(SDL_GFX_LIBRARY
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL_GFX_INCLUDE_DIR AND EXISTS "${SDL_GFX_INCLUDE_DIR}/SDL_gfxPrimitives.h")
file(STRINGS "${SDL_GFX_INCLUDE_DIR}/SDL_gfxPrimitives.h" SDL_GFX_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_GFXPRIMITIVES_MAJOR[ \t]+[0-9]+$")
file(STRINGS "${SDL_GFX_INCLUDE_DIR}/SDL_gfxPrimitives.h" SDL_GFX_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_GFXPRIMITIVES_MINOR[ \t]+[0-9]+$")
file(STRINGS "${SDL_GFX_INCLUDE_DIR}/SDL_gfxPrimitives.h" SDL_GFX_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_GFXPRIMITIVES_MICRO[ \t]+[0-9]+$")
if(SDL_GFX_INCLUDE_DIRS AND EXISTS "${SDL_GFX_INCLUDE_DIRS}/SDL_gfxPrimitives.h")
file(STRINGS "${SDL_GFX_INCLUDE_DIRS}/SDL_gfxPrimitives.h" SDL_GFX_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_GFXPRIMITIVES_MAJOR[ \t]+[0-9]+$")
file(STRINGS "${SDL_GFX_INCLUDE_DIRS}/SDL_gfxPrimitives.h" SDL_GFX_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_GFXPRIMITIVES_MINOR[ \t]+[0-9]+$")
file(STRINGS "${SDL_GFX_INCLUDE_DIRS}/SDL_gfxPrimitives.h" SDL_GFX_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_GFXPRIMITIVES_MICRO[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_GFXPRIMITIVES_MAJOR[ \t]+([0-9]+)$" "\\1" SDL_GFX_VERSION_MAJOR "${SDL_GFX_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_GFXPRIMITIVES_MINOR[ \t]+([0-9]+)$" "\\1" SDL_GFX_VERSION_MINOR "${SDL_GFX_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_GFXPRIMITIVES_MICRO[ \t]+([0-9]+)$" "\\1" SDL_GFX_VERSION_PATCH "${SDL_GFX_VERSION_PATCH_LINE}")
@ -89,18 +68,17 @@ if(SDL_GFX_INCLUDE_DIR AND EXISTS "${SDL_GFX_INCLUDE_DIR}/SDL_gfxPrimitives.h")
unset(SDL_GFX_VERSION_PATCH)
endif()
set(SDL_GFX_LIBRARIES ${SDL_GFX_LIBRARY})
set(SDL_GFX_INCLUDE_DIRS ${SDL_GFX_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_gfx
REQUIRED_VARS SDL_GFX_LIBRARIES SDL_GFX_INCLUDE_DIRS
VERSION_VAR SDL_GFX_VERSION_STRING)
# for backward compatibility
set(SDLGFX_LIBRARY ${SDL_GFX_LIBRARIES})
set(SDLGFX_INCLUDE_DIR ${SDL_GFX_INCLUDE_DIRS})
set(SDLGFX_FOUND ${SDL_GFX_FOUND})
mark_as_advanced(SDL_GFX_LIBRARY SDL_GFX_INCLUDE_DIR)
if(SDL_gfx_FOUND)
if(NOT TARGET SDL::SDL_gfx)
add_library(SDL::SDL_gfx INTERFACE IMPORTED)
set_target_properties(SDL::SDL_gfx PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SDL_GFX_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${SDL_GFX_LIBRARIES}")
endif()
endif()

View File

@ -1,9 +1,3 @@
file(MAKE_DIRECTORY ${cdroot})
find_package(SDL 1.2 REQUIRED)
find_package(SDL_mixer 1.2 REQUIRED)
find_package(SDL_gfx 2.0 REQUIRED)
set(SDL1_2_BUILD 1)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(cflags ${cflags} -Og)
else()

View File

@ -1,15 +1,5 @@
if("$ENV{PSXSDK_PATH}" STREQUAL "")
message(FATAL_ERROR "Please set PSXSDK_PATH env variable first")
endif()
find_package(PSXSDK 0.7.1 REQUIRED)
file(MAKE_DIRECTORY ${cdroot})
add_library(psx STATIC IMPORTED)
set_property(TARGET psx PROPERTY IMPORTED_LOCATION $ENV{PSXSDK_PATH}/lib/libpsx.a)
target_include_directories(psx INTERFACE
$ENV{PSXSDK_PATH}/include)
target_link_libraries(${PROJECT_NAME} PUBLIC psx fixmath)
target_compile_definitions(${PROJECT_NAME} PUBLIC FIXMATH_FAST_SIN PSXSDK_DEBUG)
add_custom_target(exe ALL elf2exe ${PROJECT_NAME}
${cdroot}/${PROJECT_NAME}.exe -mark="A homebrew game created with PSXSDK"

View File

@ -1,12 +1,3 @@
file(MAKE_DIRECTORY ${cdroot})
if("$ENV{SDL_PATH}" STREQUAL "")
message(FATAL_ERROR "please define env variable SDL_PATH")
elseif("$ENV{SDL_MIXER_PATH}" STREQUAL "")
message(FATAL_ERROR "please define env variable SDL_MIXER_PATH")
elseif("$ENV{SDL_GFX_PATH}" STREQUAL "")
message(FATAL_ERROR "please define env variable SDL_GFX_PATH")
endif()
add_custom_command(OUTPUT ${cdroot}/${PROJECT_NAME}
COMMAND i386-mingw32-strip ${PROJECT_NAME} -o ${cdroot}/${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@ -14,26 +5,9 @@ add_custom_command(OUTPUT ${cdroot}/${PROJECT_NAME}
VERBATIM)
add_custom_target(stripped-exe ALL DEPENDS ${cdroot}/${PROJECT_NAME})
add_library(SDL STATIC IMPORTED)
set_property(TARGET SDL PROPERTY IMPORTED_LOCATION $ENV{SDL_PATH}/lib/libSDL.a)
target_include_directories(SDL INTERFACE
$ENV{SDL_PATH}/include $ENV{SDL_PATH}/include/SDL)
target_link_libraries(SDL INTERFACE gdi32 user32 winmm dxguid)
add_library(SDL_mixer STATIC IMPORTED)
set_property(TARGET SDL_mixer PROPERTY IMPORTED_LOCATION
$ENV{SDL_MIXER_PATH}/lib/libSDL_mixer.a)
target_include_directories(SDL_mixer INTERFACE $ENV{SDL_MIXER_PATH}/include)
target_link_libraries(SDL_mixer INTERFACE SDL)
add_library(SDL_gfx STATIC IMPORTED)
set_property(TARGET SDL_gfx PROPERTY IMPORTED_LOCATION
$ENV{SDL_GFX_PATH}/lib/libSDL_gfx.a)
target_include_directories(SDL_gfx INTERFACE $ENV{SDL_GFX_PATH}/include)
target_link_libraries(SDL_gfx INTERFACE SDL)
target_link_libraries(SDL::SDL INTERFACE gdi32 user32 winmm dxguid)
add_compile_options(-march=i386)
set(SDL1_2_BUILD 1)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# i386-mingw32-gcc 3.4.5 does not support -Og.

View File

@ -14,7 +14,7 @@ if(PS1_BUILD)
"ps1/src/quad.c")
set(inc ${inc} "ps1/inc")
set(privinc ${privinc} "ps1/privinc")
set(privdeps ${privdeps} system)
set(privdeps ${privdeps} system PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
set(inc ${inc} "sdl-1.2/inc")
set(privinc ${privinc} "sdl-1.2/privinc")
@ -24,8 +24,8 @@ elseif(SDL1_2_BUILD)
"sdl-1.2/src/rect.c"
"sdl-1.2/src/sprite.c"
"sdl-1.2/src/quad.c")
set(deps ${deps} SDL)
set(privdeps ${privdeps} header SDL_gfx)
set(deps ${deps} SDL::SDL)
set(privdeps ${privdeps} header SDL::SDL_gfx)
endif()
add_library(gfx ${src})

View File

@ -1,7 +1,7 @@
#ifndef GFX_SDL_H
#define GFX_SDL_H
#include <SDL/SDL.h>
#include <SDL.h>
#include <stdbool.h>
#ifdef __cplusplus

View File

@ -2,7 +2,7 @@
#define GFX_SDL_12_PRIVATE_H
#include <gfx.h>
#include <SDL/SDL.h>
#include <SDL.h>
#ifdef __cplusplus
extern "C"

View File

@ -1,7 +1,7 @@
#include <gfx.h>
#include <gfx_private.h>
#include <sdl-1.2/gfx_private.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>

View File

@ -1,7 +1,7 @@
#include <gfx.h>
#include <gfx/port.h>
#include <sdl-1.2/gfx_private.h>
#include <SDL/SDL.h>
#include <SDL.h>
void rect_sort(struct rect *const r)
{

View File

@ -2,8 +2,8 @@
#include <gfx/port.h>
#include <header.h>
#include <sdl-1.2/gfx_private.h>
#include <SDL/SDL.h>
#include <SDL/SDL_rotozoom.h>
#include <SDL.h>
#include <SDL_rotozoom.h>
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>

View File

@ -3,9 +3,10 @@ set(inc "inc")
if(PS1_BUILD)
set(src ${src} "ps1/src/keyboard.c")
set(privdeps ${privdeps} PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
set(src ${src} "sdl-1.2/src/keyboard.c")
set(deps ${deps} SDL)
set(privdeps ${privdeps} SDL::SDL)
endif()
add_library(keyboard ${src})

View File

@ -1,6 +1,6 @@
#include <keyboard.h>
#include <keyboard_key.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include <stdio.h>
static void append_key(const enum keyboard_key key, struct keyboard *const k)

View File

@ -3,9 +3,10 @@ set(inc "inc")
if(PS1_BUILD)
set(src ${src} "ps1/src/mouse.c")
set(privdeps ${privdeps} PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
set(src ${src} "sdl-1.2/src/mouse.c")
set(deps ${deps} SDL)
set(privdeps ${privdeps} SDL::SDL)
endif()
add_library(mouse ${src})

View File

@ -1,5 +1,5 @@
#include <mouse.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdio.h>

View File

@ -5,10 +5,11 @@ set(src "src/pad.c")
if(PS1_BUILD)
set(src ${src} "ps1/src/pad.c")
set(inc ${inc} "ps1/inc")
set(deps ${deps} PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
set(src ${src} "sdl-1.2/src/pad.c")
set(inc ${inc} "sdl-1.2/inc")
set(deps ${deps} SDL)
set(deps ${deps} SDL::SDL)
endif()
add_library(pad ${src})

View File

@ -1,5 +1,5 @@
#include <pad.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include <stdio.h>
void pad_port_update(struct pad *const p)

View File

@ -4,13 +4,13 @@ if(PS1_BUILD)
set(src
"ps1/src/sound.c")
set(inc ${inc} "ps1/inc")
set(privdeps system)
set(privdeps system PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
set(src
"sdl-1.2/src/sound.c")
set(inc ${inc} "sdl-1.2/inc")
set(deps ${deps} SDL_mixer)
set(privdeps ${privdeps} SDL header)
set(deps ${deps} SDL::SDL_mixer)
set(privdeps ${privdeps} SDL::SDL header)
endif()
add_library(sfx ${src})

View File

@ -1,7 +1,7 @@
#ifndef SFX_SDL1_2_H
#define SFX_SDL1_2_H
#include <SDL/SDL_mixer.h>
#include <SDL_mixer.h>
#include <stdbool.h>
#ifdef __cplusplus

View File

@ -1,8 +1,8 @@
#include <sfx.h>
#include <sfx/port.h>
#include <header.h>
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#include <SDL.h>
#include <SDL_mixer.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>

View File

@ -1,13 +1,16 @@
set(inc "inc")
set(privdeps gfx sfx)
if(PS1_BUILD)
set(src "ps1/src/init.c")
set(inc ${inc} "ps1/inc")
set(privdeps ${privdeps} PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
set(src "sdl-1.2/src/system.c")
set(inc ${inc} "sdl-1.2/inc")
set(privdeps ${privdeps} SDL::SDL)
endif()
add_library(system ${src})
target_include_directories(system PUBLIC ${inc})
target_link_libraries(system PRIVATE gfx sfx)
target_link_libraries(system PRIVATE ${privdeps})

View File

@ -1,7 +1,7 @@
#include <gfx.h>
#include <sfx.h>
#include <system.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include <stdio.h>
#include <stdlib.h>