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

Add an option to treat warnings as errors #4509

Merged
merged 9 commits into from
May 6, 2022
Prev Previous commit
Next Next commit
Fixed ASSIMP_WARNINGS_MAX reference
  • Loading branch information
hgdagon authored Apr 30, 2022
commit bf32c4c40844a648ed0bbd3de618ca64a5d428d1
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ IF (WIN32)
# Multibyte character set is deprecated since at least MSVC2015 (possibly earlier)
ADD_DEFINITIONS( -DUNICODE -D_UNICODE )
ENDIF()

# Link statically against c/c++ lib to avoid missing redistriburable such as
# "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users
# a choice to opt for the shared runtime if they want.
option(USE_STATIC_CRT "Link against the static runtime libraries." OFF)

# The CMAKE_CXX_FLAGS vars can be overriden by some Visual Studio generators, so we use an alternative
# global method here:
if (${USE_STATIC_CRT})
Expand Down Expand Up @@ -328,15 +330,13 @@ ENDIF()

IF (ASSIMP_WARNINGS_AS_ERRORS)
MESSAGE(STATUS "Treating all warnings as errors (for assimp library only)")
set(ASSIMP_ERROR_MAX ON)
set(ASSIMP_WARNINGS_MAX ON)
IF (MSVC)
# TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX)
# TARGET_COMPILE_OPTIONS(assimp_cmd PRIVATE /WX)
ADD_COMPILE_OPTIONS(/WX)
TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX)
# ADD_COMPILE_OPTIONS(/WX)
ELSE()
# TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)
# TARGET_COMPILE_OPTIONS(assimp_cmd PRIVATE -Werror)
ADD_COMPILE_OPTIONS(-Werror)
TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)
# ADD_COMPILE_OPTIONS(-Werror)
ENDIF()
ENDIF()

Expand Down