From 1d4bf548c85ce5cb627ed0046f67eaf420fc0b78 Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis Date: Sat, 25 Feb 2023 15:52:00 -0500 Subject: [PATCH] Add compile options for different compilers --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0481cf..05f16e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,17 @@ include(GitDetermineVersion) # ExprTk_VERSION_PATCH, ExprTk_VERSION_PATCH_EXTRA, ExprTk_VERSION_FULL determine_version("${CMAKE_CURRENT_SOURCE_DIR}" "${GIT_EXECUTABLE}" "ExprTk") +# compiling options +if (MSVC) + add_definitions(/bigobj) + add_compile_definitions(_SECURE_SCL=0) + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + add_compile_definitions(_SCL_SECURE_NO_WARNINGS) + add_compile_definitions(_HAS_ITERATOR_DEBUGGING=0) +else () + add_compile_options(-pedantic-errors -Wall -Wextra -Werror) +endif () + # create an ExprTk option for building the library with a sanitizer option(ExprTk_USE_SANITiZER "Use a sanitizer. The sanitizer is specified by ExprTk_SANITIZER" OFF) # define the requested sanitizer