Skip to content

Commit ad7b103

Browse files
committed
Give the stb libraries unique names
1 parent ae07db7 commit ad7b103

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
option(PIXELMATCH_BUILD_TESTS "Enable building tests" OFF)
88

99
# stb libraries for tests and image_utils. Not used in pixelmatch-cpp17 itself.
10-
add_library(stb_image STATIC third_party/stb/stb_image.cpp)
11-
target_include_directories(stb_image PUBLIC third_party)
12-
target_compile_options(stb_image PRIVATE -Wno-unused-function -Wno-self-assign)
10+
add_library(pixelmatch_third_party_stb_image STATIC third_party/stb/stb_image.cpp)
11+
target_include_directories(pixelmatch_third_party_stb_image PUBLIC third_party)
12+
target_compile_options(pixelmatch_third_party_stb_image PRIVATE -Wno-unused-function -Wno-self-assign)
1313

14-
add_library(stb_image_write STATIC third_party/stb/stb_image_write.cpp)
15-
target_include_directories(stb_image_write PUBLIC third_party)
16-
target_compile_options(stb_image_write PRIVATE -Wno-unused-function -Wno-self-assign)
14+
add_library(pixelmatch_third_party_stb_image_write STATIC third_party/stb/stb_image_write.cpp)
15+
target_include_directories(pixelmatch_third_party_stb_image_write PUBLIC third_party)
16+
target_compile_options(pixelmatch_third_party_stb_image_write PRIVATE -Wno-unused-function -Wno-self-assign)
1717

1818
# Main library
1919
add_library(pixelmatch-cpp17 src/pixelmatch/pixelmatch.cc)
@@ -22,7 +22,7 @@ target_include_directories(pixelmatch-cpp17 PUBLIC src)
2222
# image_utils helper library (uses stb to load and save images)
2323
add_library(image_utils src/pixelmatch/image_utils.cc)
2424
target_include_directories(image_utils PUBLIC src)
25-
target_link_libraries(image_utils PUBLIC pixelmatch-cpp17 stb_image stb_image_write)
25+
target_link_libraries(image_utils PUBLIC pixelmatch-cpp17 pixelmatch_third_party_stb_image pixelmatch_third_party_stb_image_write)
2626

2727
if(PIXELMATCH_BUILD_TESTS)
2828
include(FetchContent)

0 commit comments

Comments
 (0)