Import SDL_gfx

This commit is contained in:
Xavier Del Campo Romero 2022-07-15 00:53:00 +02:00
parent 360ea710e0
commit 2d22b88695
5 changed files with 18 additions and 1 deletions

View File

@ -8,6 +8,7 @@ ExternalProject_Add(tools
-D CMAKE_INSTALL_PREFIX=${TOOLS_PREFIX})
project(rts)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
if(CMAKE_TOOLCHAIN_FILE MATCHES "ps1")
set(PS1_BUILD 1)

View File

@ -1,6 +1,7 @@
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")

View File

@ -3,6 +3,8 @@ 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}
@ -24,6 +26,12 @@ set_property(TARGET SDL_mixer PROPERTY IMPORTED_LOCATION
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)
add_compile_options(-march=i386)
set(SDL1_2_BUILD 1)

View File

@ -125,3 +125,10 @@ WAVE files, support for other audio formats is not required.
--disable-music-flac CC=i386-mingw32-gcc --with-sdl-prefix=$HOME/sdl-1.2.15 \
CFLAGS='-ffunction-sections -fdata-sections'
```
```sh
../SDL_gfx-2.0.26-src/configure --host=i386-mingw32 --enable-shared=no \
--prefix=$HOME/SDL_gfx-2.0.26 --with-sdl-prefix=$HOME/sdl-1.2.15 \
CFLAGS='-ffunction-sections -fdata-sections' \
CC=i386-mingw32-gcc
```

View File

@ -25,7 +25,7 @@ elseif(SDL1_2_BUILD)
"sdl-1.2/src/sprite.c"
"sdl-1.2/src/quad.c")
set(deps ${deps} SDL)
set(privdeps ${privdeps} header)
set(privdeps ${privdeps} header SDL_gfx)
endif()
add_library(gfx ${src})