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 option to disable warnings as errors. #1

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
31 changes: 17 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ option(KIERO_INCLUDE_OPENGL "Enable support for OpenGL" OFF)
option(KIERO_INCLUDE_VULKAN "Enable support for Vulkan" OFF)
option(KIERO_USE_MINHOOK "Enables \"kiero::bind\" as a wrapper around MinHook" OFF)
option(KIERO_MINHOOK_EXTERNAL "Use an externally provided MinHook instead of the bundled" OFF)
option(KIERO_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)

project(kiero VERSION 1.2.12)

Expand All @@ -21,21 +22,23 @@ set_target_properties(kiero PROPERTIES
CXX_STANDARD_REQUIRED ON
)

if (MSVC)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(kiero PRIVATE
/clang:-Wall
/clang:-Wextra
/clang:-Wcast-align
/clang:-Wconversion
/clang:-Wsign-conversion
/clang:-Wold-style-cast
/clang:-Wimplicit-fallthrough
)
if (KIERO_WARNINGS_AS_ERRORS)
if (MSVC)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(kiero PRIVATE
/clang:-Wall
/clang:-Wextra
/clang:-Wcast-align
/clang:-Wconversion
/clang:-Wsign-conversion
/clang:-Wold-style-cast
/clang:-Wimplicit-fallthrough
)
endif()
target_compile_options(kiero PRIVATE /WX /W4)
else()
message(WARNING "Non Microsoft compatible compiler detected")
endif()
target_compile_options(kiero PRIVATE /WX /W4)
else()
message(WARNING "Non Microsoft compatible compiler detected")
endif()

if (NOT (KIERO_INCLUDE_D3D9 OR KIERO_INCLUDE_D3D10 OR KIERO_INCLUDE_D3D11 OR KIERO_INCLUDE_D3D12 OR KIERO_INCLUDE_OPENGL OR KIERO_INCLUDE_VULKAN))
Expand Down