Move warnings as errors config and use in geomech libs

This commit is contained in:
Magne Sjaastad committed 2025-06-17 14:43:47 +02:00
1 parent c204593f08
commit 21bd5730f5
7 files changed
+30 -40

No files matched your search

+2 -13
View File
@@ -19,10 +19,6 @@ endif()
# Open GL
find_package(OpenGL)
option(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS
"Treat warnings as errors (stops build)" OFF
)
find_package(
Qt6
COMPONENTS Core
@@ -256,14 +252,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
)
endif()
if(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS)
if(MSVC)
target_compile_options(ApplicationLibCode PRIVATE /WX)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_compile_options(ApplicationLibCode PRIVATE -Werror)
endif()
endif()
if(MSVC)
# The following warnings are supposed to be used in ResInsight, but
# temporarily disabled to avoid too much noise warning C4245: 'return':
@@ -338,8 +326,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
target_link_libraries(
${PROJECT_NAME} PUBLIC ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES}
ApplicationLibCode PUBLIC ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES}
)
target_link_libraries(ApplicationLibCode PRIVATE ResInsightCommonSettings)
target_include_directories(
${PROJECT_NAME}
+4 -11
View File
@@ -107,14 +107,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(Commands PRIVATE -Wno-deprecated-declarations)
endif()
if(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS)
if(MSVC)
target_compile_options(Commands PRIVATE /WX)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_compile_options(Commands PRIVATE -Werror)
endif()
endif()
if(MSVC)
# The following warnings are supposed to be used in ResInsight, but
# temporarily disabled to avoid too much noise warning C4245: 'return':
@@ -138,6 +130,7 @@ if(MSVC)
endif()
set(LINK_LIBRARIES ApplicationLibCode ResultStatisticsCache)
target_link_libraries(${PROJECT_NAME} PRIVATE ${LINK_LIBRARIES})
set(LINK_LIBRARIES ApplicationLibCode ResultStatisticsCache
ResInsightCommonSettings
)
target_link_libraries(Commands PRIVATE ${LINK_LIBRARIES})
@@ -112,8 +112,8 @@ add_library(
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set(LINK_LIBRARIES LibCore cafPdmCvf cafTensor cafUserInterface CommonCode
ResultStatisticsCache
target_link_libraries(
RigGeoMechDataModel PUBLIC LibCore cafPdmCvf cafTensor cafUserInterface
CommonCode ResultStatisticsCache
)
target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES})
target_link_libraries(RigGeoMechDataModel PRIVATE ResInsightCommonSettings)
@@ -20,6 +20,7 @@ add_library(
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set(LINK_LIBRARIES RigGeoMechDataModel LibCore)
target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES})
target_link_libraries(
RifGeoMechFileInterface PUBLIC RigGeoMechDataModel LibCore
)
target_link_libraries(RifGeoMechFileInterface PRIVATE ResInsightCommonSettings)