Skip to content

Commit 5724c04

Browse files
committed
libdistributed version 0.1.0
Major Changes + libdistributed is now C++11 compatible by requiring std_compat for backwards compatibility.
1 parent f515e87 commit 5724c04

7 files changed

+323
-147
lines changed

CMakeLists.txt

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.12)
2-
project(libdistributed VERSION "0.0.11" LANGUAGES CXX)
2+
project(libdistributed VERSION "0.1.0" LANGUAGES CXX)
33

44
#correct was to set a default build type
55
# https://blog.kitware.com/cmake-and-the-default-build-type/
@@ -15,21 +15,12 @@ endif()
1515
include(CTest)
1616
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1717

18-
set(default_cxx_standard 17)
19-
if(NOT LIBDISTRIBUTED_CXX_VERSION)
20-
set(LIBDISTRIBUTED_CXX_VERSION ${default_cxx_standard} CACHE
21-
STRING "Which version of the cxx standard to expect" FORCE)
22-
set_property(CACHE LIBDISTRIBUTED_CXX_VERSION PROPERTY STRINGS 17)
23-
endif()
24-
2518
function(check_cpp_standard api)
2619
string(TOUPPER "${api}" HEADER_SUFFIX)
2720
try_compile(
2821
COMPILED
2922
${CMAKE_BINARY_DIR}
3023
SOURCES "${CMAKE_SOURCE_DIR}/checks/${api}.cc"
31-
CXX_STANDARD ${LIBDISTRIBUTED_CXX_VERSION}
32-
CXX_STANDARD_REQUIRED ON
3324
)
3425
message(STATUS "Checking for ${api}: ${COMPILED}")
3526
set(LIBDISTRIBUTED_COMPAT_HAS_${HEADER_SUFFIX} ${COMPILED} PARENT_SCOPE)
@@ -44,7 +35,8 @@ configure_file(
4435

4536
include(GNUInstallDirs)
4637

47-
find_package(MPI COMPONENTS CXX)
38+
find_package(std_compat REQUIRED)
39+
find_package(MPI COMPONENTS CXX REQUIRED)
4840

4941
option(BUILD_SHARED_LIBS "BUILD SHARED LIBRARIES" ON)
5042
add_library(libdistributed
@@ -66,8 +58,7 @@ target_include_directories(
6658
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
6759
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libdistributed>
6860
)
69-
target_link_libraries( libdistributed PUBLIC MPI::MPI_CXX)
70-
target_compile_features(libdistributed PUBLIC cxx_std_${LIBDISTRIBUTED_CXX_VERSION})
61+
target_link_libraries( libdistributed PUBLIC MPI::MPI_CXX std_compat::std_compat)
7162

7263
option(USE_CLANG_TIDY "include clang-tidy warnings in the build log" OFF)
7364
if(USE_CLANG_TIDY)

0 commit comments

Comments
 (0)