1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Description: Unbundle libstb
Use headers from libstb-dev and link directly to the library instead
of using bundled copy removed from extlibs.
Author: James Cowgill <jcowgill@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/SFML/Graphics/CMakeLists.txt
+++ b/src/SFML/Graphics/CMakeLists.txt
@@ -93,7 +93,9 @@ sfml_add_library(sfml-graphics
target_link_libraries(sfml-graphics PUBLIC sfml-window)
# stb_image sources
-target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image")
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(stb REQUIRED IMPORTED_TARGET stb)
+target_link_libraries(sfml-graphics PRIVATE PkgConfig::stb)
# glad sources
target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include")
--- a/src/SFML/Graphics/ImageLoader.cpp
+++ b/src/SFML/Graphics/ImageLoader.cpp
@@ -28,12 +28,11 @@
#include <SFML/Graphics/ImageLoader.hpp>
#include <SFML/System/InputStream.hpp>
#include <SFML/System/Err.hpp>
-#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
-#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <stb_image_write.h>
#include <cctype>
#include <iterator>
+#include <cstring>
namespace
|