#14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG

* #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG

CMAKE_CXX_FLAGS_RELEASE was overwritten with -DNO_DEBUG on Linux in
both CMakeLists.txt and Fwk/CMakeLists.txt. NO_DEBUG is not a standard
macro, so NDEBUG was never defined in Linux Release builds.

As a result, cafAssert.h fell back to CAF_ENABLE_ASSERTS 1, keeping
CAF_ASSERT (and standard assert()) active in Release and aborting the
app, even though RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE defaults to OFF.
Windows and macOS Release builds were unaffected.

Drop the override entirely so CMake supplies its default Release
flags (-O3 -DNDEBUG) on Linux, matching Windows and macOS.

Also simplify CEE_USE_QT5/CEE_USE_QT6 handling: set them directly
instead of via option() with malformed NOT DEFINED(...) guards.

Fixed missing initialization in VfpValueSelection and WellPathCellIntersectionInfo
This commit is contained in:
Magne Sjaastad authored and GitHub committed 2026-09-14 14:17:33 +02:00
1 parent 64361c2f78
commit 2120a13d63
5 files changed
+16 -22

No files matched your search

@@ -207,12 +207,13 @@ std::vector<WellPathCellIntersectionInfo>
WellPathCellIntersectionInfo extraIntersection;
extraIntersection.globCellIndex = std::numeric_limits<size_t>::max();
extraIntersection.startPoint = intersectionPoint;
extraIntersection.endPoint = firstIntersection.startPoint;
extraIntersection.startMD = initialMD;
extraIntersection.endMD = firstIntersection.startMD;
extraIntersection.intersectedCellFaceIn = cvf::StructGridInterface::NO_FACE;
extraIntersection.globCellIndex = std::numeric_limits<size_t>::max();
extraIntersection.startPoint = intersectionPoint;
extraIntersection.endPoint = firstIntersection.startPoint;
extraIntersection.startMD = initialMD;
extraIntersection.endMD = firstIntersection.startMD;
extraIntersection.intersectedCellFaceIn = cvf::StructGridInterface::NO_FACE;
extraIntersection.intersectedCellFaceOut = cvf::StructGridInterface::NO_FACE;
if ( firstIntersection.intersectedCellFaceIn != cvf::StructGridInterface::NO_FACE )
@@ -79,11 +79,11 @@ struct VfpTableSelection
struct VfpValueSelection
{
double flowRateValue;
double thpValue;
double artificialLiftQuantityValue;
double waterCutValue;
double gasLiquidRatioValue;
double flowRateValue = 0.0;
double thpValue = 0.0;
double artificialLiftQuantityValue = 0.0;
double waterCutValue = 0.0;
double gasLiquidRatioValue = 0.0;
std::vector<double> familyValues;
};
+1 -2
View File
@@ -67,7 +67,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(VIZ_MODULES_FOLDER_NAME Fwk/VizFwk)
message(STATUS "Set CEE_USE_QT6 to ON")
# Instruct cvf to use Qt6
set(CEE_USE_QT5 OFF)
set(CEE_USE_QT6 ON)
@@ -141,7 +141,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG")
endif()
include(cmake/StdStacktrace.cmake)
+3 -8
View File
@@ -19,14 +19,9 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
# Qt
if(NOT DEFINED (CEE_USE_QT5))
option(CEE_USE_QT5 "Use Qt5" ON)
endif(NOT DEFINED (CEE_USE_QT5))
if(NOT DEFINED (CEE_USE_QT6))
option(CEE_USE_QT6 "Use Qt6" OFF)
endif(NOT DEFINED (CEE_USE_QT6))
# Instruct cvf to use Qt6
set(CEE_USE_QT5 OFF)
set(CEE_USE_QT6 ON)
# CeeViz is not available here, exclude it from the build
set(CAF_EXCLUDE_CVF ON)
-1
View File
@@ -29,7 +29,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
"-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat -Wno-unused-parameter"
)
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG")
endif()
find_package(