From e40dd9b22a59ebf2b40dd3a2e8d3593150a91df8 Mon Sep 17 00:00:00 2001 From: luisangelsm Date: Mon, 30 Mar 2026 08:32:20 +0200 Subject: [PATCH] Clean up CompilerOptions.cmake --- CMakeLists.txt | 2 +- cmake/CompilerOptions.cmake | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4be52589..e000cfe6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ endif() include(GNUInstallDirs) list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -# Compiler options (MSVC flags, NOMINMAX, etc.) +# Compiler options (MSVC flags) include(cmake/CompilerOptions.cmake) # --- Build options --- diff --git a/cmake/CompilerOptions.cmake b/cmake/CompilerOptions.cmake index 2b1378dc..2ef38eb3 100644 --- a/cmake/CompilerOptions.cmake +++ b/cmake/CompilerOptions.cmake @@ -1,20 +1,11 @@ # Compiler options for YACReader -# Mirrors config.pri: C++20, NOMINMAX, MSVC conformance flags - -add_compile_definitions(NOMINMAX) if(MSVC) + # Prevent windows.h from defining min/max macros that conflict with + # std::min, std::max, std::numeric_limits::max(), etc. + add_compile_definitions(NOMINMAX) + # /Zc:__cplusplus: report correct __cplusplus value # /permissive-: strict standard conformance add_compile_options(/Zc:__cplusplus /permissive-) - - # Release optimizations (mirrors qmake QMAKE_CXXFLAGS_RELEASE) - string(APPEND CMAKE_CXX_FLAGS_RELEASE " /DNDEBUG") -elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - string(APPEND CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG") endif() - -# Qt deprecation warnings -add_compile_definitions( - QT_DEPRECATED_WARNINGS -)