Skip to content

Commit d258567

Browse files
committed
make stb_image implementation optional
1 parent 8806df7 commit d258567

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,17 @@ target_compile_definitions(nanogui
427427

428428
PRIVATE
429429
-DNANOGUI_BUILD
430-
-DNVG_STB_IMAGE_IMPLEMENTATION
431430
)
432431

432+
if (NOT NANOGUI_SKIP_STB_IMAGE_IMPLEMENTATION)
433+
# Frameworks that statically link to nanobind and which already include the
434+
# stb_image implementation bits can set this flag to avoid duplicate symbol
435+
# errors.
436+
437+
target_compile_definitions(nanogui
438+
PRIVATE -DNVG_STB_IMAGE_IMPLEMENTATION)
439+
endif()
440+
433441
target_include_directories(nanogui
434442
PUBLIC
435443
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>

0 commit comments

Comments
 (0)