Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added define flag for stb_image global symbols #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ else()
set(NANOGUI_USE_GLAD_DEFAULT OFF)
endif()

option(NANOGUI_BUILD_EXAMPLE "Build NanoGUI example application?" ON)
option(NANOGUI_BUILD_SHARED "Build NanoGUI as a shared library?" ON)
option(NANOGUI_BUILD_PYTHON "Build a Python plugin for NanoGUI?" ON)
option(NANOGUI_USE_GLAD "Use Glad OpenGL loader library?" ${NANOGUI_USE_GLAD_DEFAULT})
option(NANOGUI_INSTALL "Install NanoGUI on `make install`?" ON)
option(NANOGUI_BUILD_EXAMPLE "Build NanoGUI example application?" ON)
option(NANOGUI_BUILD_SHARED "Build NanoGUI as a shared library?" ON)
option(NANOGUI_BUILD_PYTHON "Build a Python plugin for NanoGUI?" ON)
option(NANOGUI_USE_GLAD "Use Glad OpenGL loader library?" ${NANOGUI_USE_GLAD_DEFAULT})
option(NANOGUI_INSTALL "Install NanoGUI on `make install`?" ON)
option(NANOGUI_STB_IMAGE_IMPLEMENTATION "Include global stb_image symbols in library?" ON)

set(NANOGUI_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling the Python plugin")

Expand Down Expand Up @@ -86,6 +87,12 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw" "ext_build/glfw")
# XCode, but preferable for all build systems (reduces build artifacts).
set_target_properties(glfw PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

# STB Image: include global symbols for NanoVG's stb_image library
# Disable this if linking with another library which uses stb_image
if (NANOGUI_STB_IMAGE_IMPLEMENTATION)
list(APPEND NANOGUI_EXTRA_DEFS -DNANOVG_STB_IMAGE_IMPLEMENTATION)
endif()

# Python support: add NANOGUI_PYTHON flag to all targets
if (NANOGUI_BUILD_PYTHON)
list(APPEND NANOGUI_EXTRA_DEFS -DNANOGUI_PYTHON)
Expand Down