Add MSVC options.

This commit is contained in:
Rot127 2023-02-24 14:19:53 -05:00
parent e2e2834993
commit 3b0934fb09
No known key found for this signature in database
GPG Key ID: 3812B8258810AF67
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,11 @@
# For MSVC_RUNTIME_LIBRARY
cmake_minimum_required(VERSION 3.15)
add_compile_options(-Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context)
if (MSVC)
add_compile_options(/W1 /w14189 /w16268)
else()
add_compile_options(-Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context)
endif()
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")