Skip to content

Commit

Permalink
Move sources and documentation in subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jun 20, 2023
1 parent 39d24fe commit 411506b
Show file tree
Hide file tree
Showing 53 changed files with 536 additions and 364 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build
if: "runner.os == 'Linux' && matrix.platform.cmake"
run: ./test-versioning.sh
run: ./build-scripts/test-versioning.sh

- name: Setup (CMake)
if: ${{ matrix.platform.cmake && !matrix.platform.msystem && !matrix.platform.msvc }}
Expand Down
43 changes: 22 additions & 21 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,28 @@ include $(CLEAR_VARS)
LOCAL_MODULE := SDL2_image

LOCAL_SRC_FILES := \
IMG.c \
IMG_avif.c \
IMG_bmp.c \
IMG_gif.c \
IMG_jpg.c \
IMG_jxl.c \
IMG_lbm.c \
IMG_pcx.c \
IMG_png.c \
IMG_pnm.c \
IMG_qoi.c \
IMG_stb.c \
IMG_svg.c \
IMG_tga.c \
IMG_tif.c \
IMG_webp.c \
IMG_WIC.c \
IMG_xcf.c \
IMG_xpm.c.arm \
IMG_xv.c

src/IMG.c \
src/IMG_avif.c \
src/IMG_bmp.c \
src/IMG_gif.c \
src/IMG_jpg.c \
src/IMG_jxl.c \
src/IMG_lbm.c \
src/IMG_pcx.c \
src/IMG_png.c \
src/IMG_pnm.c \
src/IMG_qoi.c \
src/IMG_stb.c \
src/IMG_svg.c \
src/IMG_tga.c \
src/IMG_tif.c \
src/IMG_webp.c \
src/IMG_WIC.c \
src/IMG_xcf.c \
src/IMG_xpm.c.arm \
src/IMG_xv.c

LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/src
LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
-DLOAD_SVG -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV \
-DLOAD_QOI
Expand Down
55 changes: 29 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,31 +189,34 @@ if(NOT DEFINED OpenGL_GL_PREFERENCE)
endif()

add_library(SDL2_image
IMG.c
IMG_WIC.c
IMG_avif.c
IMG_bmp.c
IMG_gif.c
IMG_jpg.c
IMG_jxl.c
IMG_lbm.c
IMG_pcx.c
IMG_png.c
IMG_pnm.c
IMG_qoi.c
IMG_stb.c
IMG_svg.c
IMG_tga.c
IMG_tif.c
IMG_webp.c
IMG_xcf.c
IMG_xpm.c
IMG_xv.c
src/IMG.c
src/IMG_WIC.c
src/IMG_avif.c
src/IMG_bmp.c
src/IMG_gif.c
src/IMG_jpg.c
src/IMG_jxl.c
src/IMG_lbm.c
src/IMG_pcx.c
src/IMG_png.c
src/IMG_pnm.c
src/IMG_qoi.c
src/IMG_stb.c
src/IMG_svg.c
src/IMG_tga.c
src/IMG_tif.c
src/IMG_webp.c
src/IMG_xcf.c
src/IMG_xpm.c
src/IMG_xv.c
)
add_library(SDL2_image::${sdl2_image_export_name} ALIAS SDL2_image)
target_include_directories(SDL2_image PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL2>"
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/src"
)
target_compile_definitions(SDL2_image PRIVATE
BUILD_SDL
Expand All @@ -224,7 +227,7 @@ target_compile_definitions(SDL2_image PRIVATE
target_link_libraries(SDL2_image PRIVATE $<BUILD_INTERFACE:${sdl2_target_name}>)
if(WIN32 AND SDL2IMAGE_BUILD_SHARED_LIBS)
target_sources(SDL2_image PRIVATE
version.rc
src/version.rc
)
endif()
set_target_properties(SDL2_image PROPERTIES
Expand Down Expand Up @@ -309,7 +312,7 @@ if(APPLE)
target_link_libraries(SDL2_image PRIVATE -Wl,-framework,ApplicationServices)
target_link_libraries(SDL2_image PRIVATE objc)
target_sources(SDL2_image PRIVATE
IMG_ImageIO.m
src/IMG_ImageIO.m
)

if (SDL2IMAGE_PNG AND NOT SDL2IMAGE_BACKEND_STB)
Expand Down Expand Up @@ -780,8 +783,8 @@ if(SDL2IMAGE_INSTALL)
endif()

if(SDL2IMAGE_SAMPLES)
add_executable(showanim showanim.c)
add_executable(showimage showimage.c)
add_executable(showanim examples/showanim.c)
add_executable(showimage examples/showimage.c)

find_package(SDL2main)

Expand Down
67 changes: 35 additions & 32 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,48 @@ libSDL2_imageinclude_HEADERS = \
SDL_image.h

if USE_IMAGEIO
IMAGEIO_SOURCE = IMG_ImageIO.m
IMAGEIO_SOURCE = src/IMG_ImageIO.m
endif

libSDL2_image_la_SOURCES = \
IMG.c \
IMG_avif.c \
IMG_bmp.c \
IMG_gif.c \
IMG_jpg.c \
IMG_jxl.c \
IMG_lbm.c \
IMG_pcx.c \
IMG_png.c \
IMG_pnm.c \
IMG_qoi.c \
IMG_svg.c \
IMG_stb.c \
IMG_tga.c \
IMG_tif.c \
IMG_xcf.c \
IMG_xpm.c \
IMG_xv.c \
IMG_webp.c \
IMG_WIC.c \
src/IMG.c \
src/IMG_avif.c \
src/IMG_bmp.c \
src/IMG_gif.c \
src/IMG_jpg.c \
src/IMG_jxl.c \
src/IMG_lbm.c \
src/IMG_pcx.c \
src/IMG_png.c \
src/IMG_pnm.c \
src/IMG_qoi.c \
src/IMG_svg.c \
src/IMG_stb.c \
src/IMG_tga.c \
src/IMG_tif.c \
src/IMG_xcf.c \
src/IMG_xpm.c \
src/IMG_xv.c \
src/IMG_webp.c \
src/IMG_WIC.c \
$(IMAGEIO_SOURCE) \
miniz.h \
nanosvg.h \
nanosvgrast.h \
qoi.h \
stb_image.h \
tiny_jpeg.h
src/miniz.h \
src/nanosvg.h \
src/nanosvgrast.h \
src/qoi.h \
src/stb_image.h \
src/tiny_jpeg.h

EXTRA_DIST = \
.gitmodules \
Android.mk \
CHANGES.txt \
CMakeLists.txt \
IMG_ImageIO.m \
IMG_xxx.c \
src/IMG_ImageIO.m \
src/IMG_xxx.c \
LICENSE.txt \
Makefile.os2 \
README-emscripten.txt \
docs/README-emscripten.txt \
README.txt \
SDL2_image.spec \
SDL2_imageConfig.cmake.in \
Expand All @@ -60,7 +60,7 @@ EXTRA_DIST = \
cmake \
external \
mingw \
version.rc
src/version.rc


libSDL2_image_la_LDFLAGS = \
Expand All @@ -69,7 +69,7 @@ libSDL2_image_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LT_EXTRA)
libSDL2_image_la_LIBADD = $(IMG_LIBS)
if USE_VERSION_RC
libSDL2_image_la_DEPENDENCIES = version.o
libSDL2_image_la_DEPENDENCIES = src/version.o
endif

pkgconfigdir = $(libdir)/pkgconfig
Expand All @@ -80,7 +80,10 @@ pkgconfig_DATA = SDL2_image.pc

noinst_PROGRAMS = showimage showanim

showimage_SOURCES = examples/showimage.c
showimage_LDADD = libSDL2_image.la

showanim_SOURCES = examples/showanim.c
showanim_LDADD = libSDL2_image.la

SUBDIRS = .
Expand Down
Loading

0 comments on commit 411506b

Please sign in to comment.