diff --git a/3rdparty/stb_image_wrapper.cpp b/3rdparty/stb_image_wrapper.cpp deleted file mode 100644 index 6cba77fb..00000000 --- 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 9c7cce4d..ac28c6ed 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()