mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Use system-installed lodepng if BUNDLE_DEPENDENCIES=OFF (#1250)
This commit is contained in:
@@ -240,6 +240,7 @@ if(APPLE)
|
|||||||
set(PFS_SRC ${PFS_SRC} ../third_party/physfs/src/physfs_platform_apple.m)
|
set(PFS_SRC ${PFS_SRC} ../third_party/physfs/src/physfs_platform_apple.m)
|
||||||
endif()
|
endif()
|
||||||
set(PNG_SRC src/lodepng_wrapper.c)
|
set(PNG_SRC src/lodepng_wrapper.c)
|
||||||
|
set(PNG_DEF -DLODEPNG_NO_COMPILE_ALLOCATORS -DLODEPNG_NO_COMPILE_DISK)
|
||||||
set(CHM_SRC ../third_party/c-hashmap/map.c)
|
set(CHM_SRC ../third_party/c-hashmap/map.c)
|
||||||
set(SBIDI_SRC ../third_party/SheenBidi/Source/SheenBidi.c)
|
set(SBIDI_SRC ../third_party/SheenBidi/Source/SheenBidi.c)
|
||||||
|
|
||||||
@@ -341,14 +342,6 @@ else()
|
|||||||
set_source_files_properties(${CHM_SRC} PROPERTIES COMPILE_FLAGS -std=c99)
|
set_source_files_properties(${CHM_SRC} PROPERTIES COMPILE_FLAGS -std=c99)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Unfortunately, it doesn't seem like distros package LodePNG
|
|
||||||
add_library(lodepng-static STATIC ${PNG_SRC})
|
|
||||||
|
|
||||||
target_compile_definitions(lodepng-static PRIVATE
|
|
||||||
-DLODEPNG_NO_COMPILE_ALLOCATORS
|
|
||||||
-DLODEPNG_NO_COMPILE_DISK
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(c-hashmap-static STATIC ${CHM_SRC})
|
add_library(c-hashmap-static STATIC ${CHM_SRC})
|
||||||
|
|
||||||
add_library(sheenbidi-static STATIC ${SBIDI_SRC})
|
add_library(sheenbidi-static STATIC ${SBIDI_SRC})
|
||||||
@@ -361,12 +354,14 @@ target_include_directories(sheenbidi-static PRIVATE
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(BUNDLE_DEPENDENCIES)
|
if(BUNDLE_DEPENDENCIES)
|
||||||
list(APPEND STATIC_LIBRARIES physfs-static tinyxml2-static lodepng-static c-hashmap-static faudio-static sheenbidi-static)
|
list(APPEND STATIC_LIBRARIES lodepng-static physfs-static tinyxml2-static c-hashmap-static faudio-static sheenbidi-static)
|
||||||
else()
|
else()
|
||||||
list(APPEND STATIC_LIBRARIES lodepng-static c-hashmap-static sheenbidi-static)
|
list(APPEND STATIC_LIBRARIES c-hashmap-static sheenbidi-static)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUNDLE_DEPENDENCIES)
|
if(BUNDLE_DEPENDENCIES)
|
||||||
|
add_library(lodepng-static STATIC ${PNG_SRC})
|
||||||
|
target_compile_definitions(lodepng-static PRIVATE ${PNG_DEF})
|
||||||
add_library(tinyxml2-static STATIC ${XML2_SRC})
|
add_library(tinyxml2-static STATIC ${XML2_SRC})
|
||||||
add_library(physfs-static STATIC ${PFS_SRC})
|
add_library(physfs-static STATIC ${PFS_SRC})
|
||||||
target_compile_definitions(physfs-static PRIVATE
|
target_compile_definitions(physfs-static PRIVATE
|
||||||
@@ -382,7 +377,11 @@ if(BUNDLE_DEPENDENCIES)
|
|||||||
|
|
||||||
target_link_libraries(VVVVVV ${STATIC_LIBRARIES})
|
target_link_libraries(VVVVVV ${STATIC_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(VVVVVV ${STATIC_LIBRARIES} physfs tinyxml2 FAudio)
|
target_compile_definitions(VVVVVV PRIVATE
|
||||||
|
${PNG_DEF}
|
||||||
|
-DSYSTEM_LODEPNG
|
||||||
|
)
|
||||||
|
target_link_libraries(VVVVVV ${STATIC_LIBRARIES} physfs tinyxml2 FAudio lodepng)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,6 @@
|
|||||||
|
#ifdef SYSTEM_LODEPNG
|
||||||
|
#include <lodepng.h>
|
||||||
|
#else
|
||||||
/* Workaround for being unable to rename lodepng.cpp to lodepng.c */
|
/* Workaround for being unable to rename lodepng.cpp to lodepng.c */
|
||||||
#include "../../third_party/lodepng/lodepng.cpp"
|
#include "../../third_party/lodepng/lodepng.cpp"
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user