osslsigncode/cmake/SetOptions.cmake
Michał Trojnara 6a873c3a49 simplify cmake
2022-07-16 20:01:11 +02:00

31 lines
725 B
CMake

# add command line options
# set Release build mode
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
endif()
option(enable-strict "Enable strict compile mode" OFF)
option(enable-pedantic "Enable pedantic compile mode" OFF)
option(with-curl "Enable curl" ON)
# enable compile options
if(enable-strict)
message(STATUS "Enable strict compile mode")
if(MSVC)
# Microsoft Visual C warning level
add_compile_options(/Wall)
else()
add_compile_options(-Wall -Wextra)
endif()
endif()
if(enable-pedantic)
message(STATUS "Enable pedantic compile mode")
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(-pedantic)
endif()
endif()