From 580d478f654351fa44ee0dddfd54172adb913d13 Mon Sep 17 00:00:00 2001 From: Alex Spataru Date: Sun, 10 Nov 2024 12:24:33 -0500 Subject: [PATCH] Remove compiler optimizations to avoid strange issues --- CMakeLists.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64ad3822..479a96cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,21 +58,21 @@ add_definitions(-DPROJECT_DISPNAME="${PROJECT_DISPNAME}") # Compiler flags #------------------------------------------------------------------------------- -if(CMAKE_BUILD_TYPE STREQUAL "Release") - if(WIN32 AND MINGW) - set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -g0 -funroll-loops") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections") - elseif (WIN32 AND MSVC) - set(CMAKE_CXX_FLAGS "/O2 /W3 /GL /arch:AVX2 /fp:fast /Zi") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /OPT:ICF /LTCG /DEBUG") - elseif(APPLE) - set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -g0 -flto=full -funroll-loops") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,-dead_strip -flto=full") - elseif(UNIX) - set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -g0 -flto -funroll-loops") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -flto") - endif() -endif() +#if(CMAKE_BUILD_TYPE STREQUAL "Release") +# if(WIN32 AND MINGW) +# set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -g0 -funroll-loops") +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections") +# elseif (WIN32 AND MSVC) +# set(CMAKE_CXX_FLAGS "/O2 /W3 /GL /arch:AVX2 /fp:fast /Zi") +# set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /OPT:ICF /LTCG /DEBUG") +# elseif(APPLE) +# set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -g0 -flto=full -funroll-loops") +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,-dead_strip -flto=full") +# elseif(UNIX) +# set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -g0 -flto -funroll-loops") +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -flto") +# endif() +#endif() if (UNIX AND NOT APPLE) set(PROJECT_EXECUTABLE "serial-studio")