Patched library garbage
All checks were successful
JCS-Prod/RSE-Texture/pipeline/pr-master This commit looks good
JCS-Prod/RSE-Texture/pipeline/head This commit looks good

This commit is contained in:
JackCarterSmith 2022-09-18 16:01:18 +02:00
parent 49fa1278ad
commit d6b94f8c79
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
3 changed files with 43 additions and 35 deletions

View File

@ -33,6 +33,7 @@ set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation d
# Compilation option # Compilation option
option(RSPTEXTURE_SHARED "Build shared lib" ON) option(RSPTEXTURE_SHARED "Build shared lib" ON)
option(RSPTEXTURE_STATIC "Build static lib" ON) option(RSPTEXTURE_STATIC "Build static lib" ON)
option(BUILD_TOOLS "Build lib tools" ON)
# Push compile infos to source # Push compile infos to source
@ -51,9 +52,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
unset(RSE_TEXTURE_TARGETS_LIST) unset(RSE_TEXTURE_TARGETS_LIST)
add_subdirectory(RSPTextureLib) add_subdirectory(RSPTextureLib)
add_subdirectory(RSETexture) add_subdirectory(RSETexture)
if(BUILD_TOOLS)
set(RSE_TEXTURE_TARGETS_LIST rse-texture)
endif()
if(RSPTEXTURE_SHARED) if(RSPTEXTURE_SHARED)
list(APPEND RSE_TEXTURE_TARGETS_LIST rsp-texture-lib) list(APPEND RSE_TEXTURE_TARGETS_LIST rsp-texture-lib)
endif() endif()
@ -66,6 +64,9 @@ if(NOT RSE_TEXTURE_TARGETS_LIST)
"Please enable at least one of the following options: " "Please enable at least one of the following options: "
"RSPTEXTURE_STATIC, RSPTEXTURE_SHARED") "RSPTEXTURE_STATIC, RSPTEXTURE_SHARED")
endif() endif()
if(BUILD_TOOLS)
list(APPEND RSE_TEXTURE_TARGETS_LIST rse-texture)
endif()
# GPG signature custom command # GPG signature custom command

View File

@ -10,6 +10,7 @@
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
if(BUILD_TOOLS)
# Import needed packages and references their include path # Import needed packages and references their include path
find_package(PNG 1.6.37 REQUIRED) find_package(PNG 1.6.37 REQUIRED)
include_directories(${PNG_INCLUDE_DIR}) include_directories(${PNG_INCLUDE_DIR})
@ -44,3 +45,4 @@ if(RSPTEXTURE_SHARED)
elseif(RSPTEXTURE_STATIC) elseif(RSPTEXTURE_STATIC)
target_link_libraries(rse-texture PRIVATE rsp-texture-libstatic ${PNG_LIBRARIES}) target_link_libraries(rse-texture PRIVATE rsp-texture-libstatic ${PNG_LIBRARIES})
endif() endif()
endif()

View File

@ -34,14 +34,19 @@ typedef union u_rsptexture_parameters {
// Lib's structure definitions // Lib's structure definitions
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef MEMFILE #ifndef MEMFILE_DEF
typedef char* MEMFILE; typedef char* MEMFILE;
#define MEMFILE_DEF
#endif #endif
#ifndef T_R8G8B8
#ifndef T_R8G8B8_DEF
typedef struct r8g8b8 { unsigned char r,g,b; } T_R8G8B8; typedef struct r8g8b8 { unsigned char r,g,b; } T_R8G8B8;
#define T_R8G8B8_DEF
#endif #endif
#ifndef T_R8G8B8A8
#ifndef T_R8G8B8A8_DEF
typedef struct r8g8b8a8 { unsigned char r,g,b,a; } T_R8G8B8A8; typedef struct r8g8b8a8 { unsigned char r,g,b,a; } T_R8G8B8A8;
#define T_R8G8B8A8_DEF
#endif #endif
typedef enum e_mat_type { typedef enum e_mat_type {