mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
Add minimum requirements for CMake, gcc and clang
On Linux, link with stdc++exp Define requirements in README
This commit is contained in:
1 parent
53517fad83
commit
57017a166c
4 files changed
+38
-4
No files matched your search
@@ -303,10 +303,13 @@ set(LINK_LIBRARIES
|
||||
${RI_LIBRARIES}
|
||||
)
|
||||
|
||||
# According to ivarun this is needed on OpenSuse, and Fedora. See:
|
||||
# https://github.com/OPM/ResInsight/pull/7
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
# According to ivarun rt is needed on OpenSuse, and Fedora. See:
|
||||
# https://github.com/OPM/ResInsight/pull/7
|
||||
list(APPEND EXTERNAL_LINK_LIBRARIES rt)
|
||||
|
||||
# stdc++exp is required for std::stacktrace
|
||||
list(APPEND EXTERNAL_LINK_LIBRARIES stdc++exp)
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
|
||||
@@ -1,11 +1,37 @@
|
||||
# The way boost is configured and used in Boost 1.86 requires CMake 3.26
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
# Check if CMake version is 4.0 or higher
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.0)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"CMake version ${CMAKE_VERSION} detected. We are investigating issues for CMake 4. Use CMake 3.x to build ResInsight."
|
||||
)
|
||||
endif()
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
include(FetchContent)
|
||||
|
||||
project(ResInsight)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Minimum GCC version is 13, detected version: ${CMAKE_CXX_COMPILER_VERSION}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Minimum supported version is Clang 19, detected version: ${CMAKE_CXX_COMPILER_VERSION}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Ensure all binary files ensd up in the same folder as the executable
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
||||
@@ -46,6 +46,13 @@ ResInsight is cross-platform with automated testing on:
|
||||
```
|
||||
git clone git://github.com/OPM/ResInsight.git
|
||||
```
|
||||
### Minimum Requirements
|
||||
gcc 13
|
||||
clang 19
|
||||
CMake 3.15 (CMake 4 is currently not supported)
|
||||
MSVC 2022 17.4
|
||||
|
||||
These requirements are defined by used features in c++23 like std::stacktrace and std::expected.
|
||||
|
||||
### Dependencies
|
||||
Most dependencies are managed using vcpkg as defined in [vcpkg.json](https://github.com/OPM/ResInsight/blob/dev/vcpkg.json)
|
||||
|
||||
@@ -11,8 +11,6 @@ if (NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
elseif(COMPILER_SUPPORTS_CXX0X)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
else()
|
||||
message(SEND_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in new issue
Block a user