Skip to content

Commit

Permalink
update code for image coders
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjipeng committed Dec 1, 2024
1 parent 920b6dc commit 60d86d8
Show file tree
Hide file tree
Showing 42 changed files with 456 additions and 16 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option(OPT_EXTENSIONS "Build extension libraries." ON)
option(OPT_TESTS "Build test apps" ON)
option(OPT_DEMOS "Build example demos" ON)
option(OPT_UNITTEST "Build unit tests" OFF)
option(OPT_SANITIZE "Build with Sanitizer on DEBUG mode" OFF)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
Expand Down
9 changes: 7 additions & 2 deletions build/configs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ if (WIN32)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W3 /WX /Ot /GF /Gm- /GR- /Gy /GL /Zc:wchar_t-")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /WX /Ot /GF /Gm- /GR- /Gy /GL /Zc:wchar_t-")
elseif (UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -O0 -Wall -g -Wno-unused-result")
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -O0 -Wall -g -std=c++11 -fno-rtti -fno-exceptions -Wno-unused-result -Wno-register -Wno-attributes")
if (OPT_SANITIZE)
set(SANITIZE "-fsanitize=address -fsanitize=leak -fsanitize=undefined")
else()
set(SANITIZE "")
endif()
set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -O0 -Wall -g -Wno-unused-result ${SANITIZE}")
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -O0 -Wall -g -std=c++11 -fno-rtti -fno-exceptions -Wno-unused-result -Wno-register -Wno-attributes ${SANITIZE}")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O3 -Wall -Wno-unused-result")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -Wall -std=c++11 -fno-rtti -fno-exceptions -Wno-unused-result -Wno-register -Wno-attributes")
elseif (APPLE)
Expand Down
2 changes: 1 addition & 1 deletion ext/ext.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Copyright (C) 2024 Zhang Ji Peng
# Contact: [email protected]

include (${CMAKE_CURRENT_LIST_DIR}/image_loader/image.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/image_coders/image.cmake)

24 changes: 24 additions & 0 deletions ext/image_coders/apple/apple.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Picasso - a vector graphics library
#
# Copyright (C) 2024 Zhang Ji Peng
# Contact: [email protected]

set(PXIMAGE_DIR ${PROJECT_ROOT}/ext/image_coders/apple)

set(PXIMAGE_SOURCES
${PXIMAGE_DIR}/../psx_image_io.h
${PXIMAGE_DIR}/../psx_image_io.c
${PXIMAGE_DIR}/images_module.m
)

set(LIBX_CGIMAGE psxm_image_cg)

add_definitions(-DEXPORT)
add_library(${LIBX_CGIMAGE} ${PXIMAGE_SOURCES})
#target_link_libraries(${LIBX_CGIMAGE} PRIVATE jpeg)
install(TARGETS ${LIBX_CGIMAGE} LIBRARY DESTINATION lib/modules ARCHIVE DESTINATION lib/modules)

set_target_properties(${LIBX_CGIMAGE}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules"
)
Loading

0 comments on commit 60d86d8

Please sign in to comment.