Skip to content

Commit

Permalink
Added NOMINMAX to MSVC builds.
Browse files Browse the repository at this point in the history
Fix MSVC error due to WinDef.h redefining min/max.
  • Loading branch information
bjornpiltz authored and Piltz, Björn committed Oct 11, 2023
1 parent 15d86b1 commit 0026419
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ add_library(QGLViewer SHARED ${QGLViewer_SRC})
target_include_directories(QGLViewer INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(QGLViewer PRIVATE ${QtLibs} OpenGL::GL OpenGL::GLU)

if(MSVC)
# Avoid a compiler error when using std::min/std::max.
target_compile_definitions(QGLViewer PRIVATE NOMINMAX)
endif()

# Example: animation.
set(animation_SRC
"${PROJECT_SOURCE_DIR}/examples/animation/animation.cpp"
Expand Down

0 comments on commit 0026419

Please sign in to comment.