From 907016242c12a69f80a9e3b2c8685473aa12f49f Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Sun, 7 Jun 2026 14:32:55 +0200 Subject: [PATCH] Build stb_image directly from the stb header --- 3rdparty/stb_image_wrapper.cpp | 3 --- cmake/stb.cmake | 10 +++++++--- 2 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 3rdparty/stb_image_wrapper.cpp diff --git a/3rdparty/stb_image_wrapper.cpp b/3rdparty/stb_image_wrapper.cpp deleted file mode 100644 index 6cba77fbf..000000000 --- a/3rdparty/stb_image_wrapper.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#define STB_IMAGE_IMPLEMENTATION - -#include "stb/stb_image.h" diff --git a/cmake/stb.cmake b/cmake/stb.cmake index 9c7cce4d3..ac28c6edb 100644 --- a/cmake/stb.cmake +++ b/cmake/stb.cmake @@ -1,8 +1,12 @@ include_guard() function(ppc_link_stb exec_func_lib) - add_library(stb_image STATIC - ${CMAKE_SOURCE_DIR}/3rdparty/stb_image_wrapper.cpp) - target_include_directories(stb_image PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/stb) + set(stb_image_header ${CMAKE_SOURCE_DIR}/3rdparty/stb/stb_image.h) + + add_library(stb_image STATIC ${stb_image_header}) + set_source_files_properties(${stb_image_header} PROPERTIES LANGUAGE C) + set_target_properties(stb_image PROPERTIES EXPORT_COMPILE_COMMANDS OFF) + target_compile_definitions(stb_image PRIVATE STB_IMAGE_IMPLEMENTATION) + target_include_directories(stb_image PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty) target_link_libraries(${exec_func_lib} PUBLIC stb_image) endfunction()