Skip to content

Commit

Permalink
GH-477 Don't force C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
AnarManafov committed Jan 3, 2024
1 parent a47c1d1 commit e1ec99b
Show file tree
Hide file tree
Showing 28 changed files with 207 additions and 151 deletions.
4 changes: 4 additions & 0 deletions BuildSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ set( CREATE_BOOST_SYMLINKS FALSE CACHE BOOL "Create boost (libboost_*) symlinks
#
set( BUILD_TESTS ON CACHE BOOL "Build DDS tests" FORCE )

#
# C++ Standard
#
# set(CMAKE_CXX_STANDARD 20 CACHE STRING "Default value for CXX_STANDARD property of targets")
21 changes: 17 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2014-2023 GSI, Inc. All rights reserved.
# Copyright 2014-2024 GSI, Inc. All rights reserved.
#
#
#
Expand All @@ -16,9 +16,22 @@ string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")

set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ standard version to use (default is 20)")
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(PROJECT_CXX_STANDARD 17)
# Handle C++ standard level
if(CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD VERSION_LESS PROJECT_CXX_STANDARD)
message(FATAL_ERROR "A minimum CMAKE_CXX_STANDARD of ${PROJECT_CXX_STANDARD} is required.")
endif()

if(CMAKE_CXX_STANDARD)
set(PROJECT_CXX_STANDARD ${CMAKE_CXX_STANDARD})
endif()
message( STATUS "C++ Standard: ${PROJECT_CXX_STANDARD}" )

# Set -fPIC as default for all library types
if(NOT CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

# Arch
execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down
269 changes: 128 additions & 141 deletions ReleaseNotes.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dds-agent-cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ endif()

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-commander/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
dds_misc_lib
dds_proto_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-custom-cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-daemonize/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project(dds-daemonize)

add_executable(${PROJECT_NAME} src/main.cpp)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-info/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-intercom-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ set(SRC_HDRS
)

add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${SRC_HDRS_INT} ${SRC_HDRS})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
2 changes: 2 additions & 0 deletions dds-misc-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ set(HEADER_FILES_EXT
)

add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} ${HEADER_FILES_EXT})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
1 change: 1 addition & 0 deletions dds-pipe-log-engine-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${PROJECT_NAME} SHARED
src/PipeLogEngine.cpp
src/PipeLogEngine.h
)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
1 change: 1 addition & 0 deletions dds-protocol-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ set(SRC_HDRS
)

add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${SRC_HDRS})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
2 changes: 2 additions & 0 deletions dds-session/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-submit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions dds-tools-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ set(HEADER_FILES_EXT
)

add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} ${HEADER_FILES_EXT})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
2 changes: 2 additions & 0 deletions dds-topology-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ set(HEADER_FILES_EXT
)

add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} ${HEADER_FILES_EXT})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
2 changes: 2 additions & 0 deletions dds-topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
4 changes: 4 additions & 0 deletions dds-tutorials/dds-tutorial1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ set(task task-type-one)

add_executable(${task} task-type-one.cpp)

target_compile_features(${task} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${task}
PUBLIC
dds_intercom_lib
Expand All @@ -30,6 +32,8 @@ set(task task-type-two)

add_executable(${task} task-type-two.cpp)

target_compile_features(${task} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${task}
PUBLIC
dds_intercom_lib
Expand Down
4 changes: 4 additions & 0 deletions dds-tutorials/dds-tutorial2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ set(task task-custom-cmd)

add_executable(${task} task-custom-cmd.cpp)

target_compile_features(${task} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${task}
PUBLIC
dds_intercom_lib
Expand All @@ -30,6 +32,8 @@ set(task ui-custom-cmd)

add_executable(${task} ui-custom-cmd.cpp)

target_compile_features(${task} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${task}
PUBLIC
dds_intercom_lib
Expand Down
4 changes: 4 additions & 0 deletions dds-user-defaults/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ set(HEADER_FILES

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
Expand All @@ -36,6 +38,8 @@ target_link_libraries(${PROJECT_NAME}
set(target "dds_user_defaults_lib")
add_library(${target} SHARED ${LIB_SOURCE_FILES} ${HEADER_FILES})
add_library(${PROJECT_NAME}::${target_lib} ALIAS ${target})

target_compile_features(${target} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})
#
# Set Target version
#
Expand Down
10 changes: 5 additions & 5 deletions docs/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ DDS UI/Server/WN run on Linux and Mac OS X.

### General requirements

- Incoming connection on dds-commander port (configurable)
- a C++11 compiler
- [cmake](http://www.cmake.org/) 3.23.1 or higher
- [BOOST](http://www.boost.org/) 1.75 or higher (built by a C++11 compiler, with C++11 enabled)
- Incoming connection on dds-commander port (configurable).
- A C++17 or a higher compiler.
- [cmake](http://www.cmake.org/) 3.23.1 or higher.
- [BOOST](http://www.boost.org/) 1.75 or higher.
- shell: [BASH (or a compatible one)](http://en.wikipedia.org/wiki/Bash_(Unix_shell))

### Additional requirements for the SSH plug-in

- A public key access (or password less, via ssh-agend, for example) to destination worker nodes.
- A public key access (or password less, via ssh-agent, for example) to destination worker nodes.

## Agents

Expand Down
2 changes: 2 additions & 0 deletions plugins/dds-submit-localhost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project(dds-submit-localhost)

add_executable(${PROJECT_NAME} src/main.cpp)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions plugins/dds-submit-lsf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project(dds-submit-lsf)

add_executable(${PROJECT_NAME} src/main.cpp)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions plugins/dds-submit-pbs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project(dds-submit-pbs)

add_executable(${PROJECT_NAME} src/main.cpp)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
2 changes: 2 additions & 0 deletions plugins/dds-submit-slurm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project(dds-submit-slurm)

add_executable(${PROJECT_NAME} src/main.cpp)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_proto_lib
Expand Down
2 changes: 2 additions & 0 deletions plugins/dds-submit-ssh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ set(SRC_HDRS

add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${SRC_HDRS})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
dds_misc_lib
Expand Down
4 changes: 3 additions & 1 deletion proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTOBUF_FILELIST})

SET_SOURCE_FILES_PROPERTIES(${PROTO_SRC} ${PROTO_INCL} PROPERTIES GENERATED TRUE)

add_library(dds_proto_lib ${PROTO_SRCS} ${PROTO_INCL})
add_library(${PROJECT_NAME} ${PROTO_SRCS} ${PROTO_INCL})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${PROJECT_CXX_STANDARD})

target_link_libraries(${PROJECT_NAME}
PUBLIC
Expand Down

0 comments on commit e1ec99b

Please sign in to comment.