Skip to content

Commit f55d391

Browse files
authored
fetch stb (Kenix3#552)
1 parent 0a45004 commit f55d391

File tree

8 files changed

+18
-9639
lines changed

8 files changed

+18
-9639
lines changed

cmake/dependencies/common.cmake

+15
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,18 @@ if(NOT EXCLUDE_MPQ_SUPPORT)
4141
FetchContent_MakeAvailable(StormLib)
4242
list(APPEND ADDITIONAL_LIB_INCLUDES ${stormlib_SOURCE_DIR}/src)
4343
endif()
44+
45+
#=================== STB ===================
46+
set(STB_DIR ${CMAKE_BINARY_DIR}/_deps/stb)
47+
file(DOWNLOAD "https://github.com/nothings/stb/raw/0bc88af4de5fb022db643c2d8e549a0927749354/stb_image.h" "${STB_DIR}/stb_image.h")
48+
file(WRITE "${STB_DIR}/stb_impl.c" "#define STB_IMAGE_IMPLEMENTATION\n#include \"stb_image.h\"")
49+
50+
add_library(stb STATIC)
51+
52+
target_sources(stb PRIVATE
53+
${STB_DIR}/stb_image.h
54+
${STB_DIR}/stb_impl.c
55+
)
56+
57+
target_include_directories(stb PUBLIC ${STB_DIR})
58+
list(APPEND ADDITIONAL_LIB_INCLUDES ${STB_DIR})

extern/CMakeLists.txt

-13
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,3 @@ set(THREADPOOL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thread-pool)
4141
add_library(ThreadPool INTERFACE)
4242

4343
target_include_directories(ThreadPool INTERFACE ${THREADPOOL_DIR})
44-
45-
#=================== STB ===================
46-
47-
set(STB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb)
48-
add_library(stb STATIC)
49-
50-
target_sources(stb PRIVATE
51-
${STB_DIR}/stb_image.h
52-
${STB_DIR}/stb_image_write.h
53-
${STB_DIR}/stb_impl.c
54-
)
55-
56-
target_include_directories(stb PUBLIC ${STB_DIR})

extern/stb/stb_image.h

-7,897
This file was deleted.

0 commit comments

Comments
 (0)