Skip to content

Commit 3a4ef46

Browse files
authored
Build stb_image directly from the stb header (#805)
1 parent 1b8da69 commit 3a4ef46

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

3rdparty/stb_image_wrapper.cpp

Lines changed: 0 additions & 3 deletions
This file was deleted.

cmake/stb.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
include_guard()
22

33
function(ppc_link_stb exec_func_lib)
4-
add_library(stb_image STATIC
5-
${CMAKE_SOURCE_DIR}/3rdparty/stb_image_wrapper.cpp)
6-
target_include_directories(stb_image PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/stb)
4+
set(stb_image_header ${CMAKE_SOURCE_DIR}/3rdparty/stb/stb_image.h)
5+
6+
add_library(stb_image STATIC ${stb_image_header})
7+
set_source_files_properties(${stb_image_header} PROPERTIES LANGUAGE C)
8+
set_target_properties(stb_image PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
9+
target_compile_definitions(stb_image PRIVATE STB_IMAGE_IMPLEMENTATION)
10+
target_include_directories(stb_image PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty)
711
target_link_libraries(${exec_func_lib} PUBLIC stb_image)
812
endfunction()

0 commit comments

Comments
 (0)