Move "add_compile_options" behind project() command.

This commit is contained in:
Rot127 2023-04-06 03:58:09 -05:00
parent c3cc9ae533
commit f7fe2fc9cc

View File

@ -1,12 +1,6 @@
# For MSVC_RUNTIME_LIBRARY
cmake_minimum_required(VERSION 3.15)
if (CMAKE_C_COMPILER_ID MATCHES "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")
endif()
@ -31,6 +25,13 @@ project(capstone
VERSION 5.0
)
if (MSVC)
add_compile_options(/W1 /w14189 /w16268)
else()
add_compile_options(-Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context)
endif()
# to configure the options specify them in in the command line or change them in the cmake UI.
# Don't edit the makefile!
option(BUILD_SHARED_LIBS "Build shared library" OFF)