From 4cfc3f57e7d6f5d43094279be48433ef2f7aa6a6 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 5 Oct 2019 23:50:01 +0200 Subject: [PATCH 1/1] Revert "Add '-O0' flag for: cmake -DCMAKE_BUILD_TYPE=Debug" The SimGrid way to request non-optimized builds is -Denable_compile_optimizations=OFF I agree that this is not very user-friendly, and your commit looked nice, but it actually broke the build as enable_debug was set to false in release mode. As a result, -DNDEBUG was passed to the compilation, removing all xbt_assert() and leading to many compilation issues since our code does not compile without the asserts. This reverts commit a4d4e2488e05031945fa3f1dd887e34c05cfa948. --- CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 907afc08c4..94a78f409f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,13 +4,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/M project(SimGrid C CXX) -## This is a better way to set the flags: -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 ${CXXFLAGS}") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CXXFLAGS}") - ## Save compiler flags preset with environment variables CFLAGS or CXXFLAGS; ## they will used within smpicc, smpicxx. ## Do it early so that we get their genuine values. The same will be done later for Fortran. -- 2.20.1