Skip to content

Commit ac90e73

Browse files
authored
Merge pull request #14 from JohanMabille/cpp17
Upgraded to xeus-zmq 1.3.0 and CMakeLists cleanup
2 parents 59084b3 + b8cd32c commit ac90e73

File tree

3 files changed

+4
-34
lines changed

3 files changed

+4
-34
lines changed

CMakeLists.txt

+2-32
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ endif ()
6363
# ============
6464

6565
set(xtl_REQUIRED_VERSION 0.7.0)
66-
set(xeus_REQUIRED_VERSION 3.0.5)
66+
set(xeus_REQUIRED_VERSION 3.2.0)
6767

6868
if (NOT TARGET xtl)
6969
find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED)
@@ -74,28 +74,6 @@ endif ()
7474

7575
find_package(nelson)
7676

77-
# Flags
78-
# =====
79-
include(CheckCXXCompilerFlag)
80-
81-
if (MSVC)
82-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4141")
83-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4018 /wd4267 /wd4715 /wd4146 /wd4129")
84-
endif ()
85-
86-
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
87-
if (NOT EMSCRIPTEN)
88-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-parameter -Wextra -Wreorder")
89-
endif ()
90-
91-
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP_17_FLAG)
92-
if (HAS_CPP_17_FLAG)
93-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
94-
else ()
95-
message(FATAL_ERROR "Unsupported compiler -- xeus requires C++17 support!")
96-
endif ()
97-
endif ()
98-
9977
# Source files
10078
# ============
10179

@@ -123,6 +101,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
123101
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib; ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
124102

125103
macro(xnelson_set_common_options target_name)
104+
target_compile_features(${target_name} PRIVATE cxx_std_17)
126105
if (MSVC)
127106
target_compile_options(${target_name} PUBLIC /wd4251 /wd4141)
128107
target_compile_options(${target_name} PUBLIC /wd4018 /wd4267 /wd4715 /wd4146 /wd4129)
@@ -133,14 +112,6 @@ macro(xnelson_set_common_options target_name)
133112
CMAKE_CXX_COMPILER_ID MATCHES "Intel")
134113

135114
target_compile_options(${target_name} PUBLIC -Wunused-parameter -Wextra -Wreorder)
136-
137-
# C++17 flag
138-
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP_17_FLAG)
139-
if (HAS_CPP_17_FLAG)
140-
target_compile_features(${target_name} PRIVATE cxx_std_17)
141-
else ()
142-
message(FATAL_ERROR "Unsupported compiler -- xeus-nelson requires C++17 support!")
143-
endif ()
144115
endif ()
145116

146117
if (APPLE)
@@ -264,7 +235,6 @@ endif ()
264235
if (XEUS_NELSON_BUILD_EXECUTABLE)
265236
find_package(xeus-zmq 1.0.2 REQUIRED)
266237
add_executable(xnelson ${XEUS_NELSON_MAIN_SRC})
267-
target_compile_features(xnelson PRIVATE cxx_std_17)
268238
xnelson_set_common_options(xnelson)
269239
xnelson_set_kernel_options(xnelson)
270240
target_link_libraries(xnelson PRIVATE xeus-zmq)

environment-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77
- ninja
88
- cxx-compiler
99
# Host dependencies
10-
- xeus-zmq >=1.0.2,<2.0
10+
- xeus-zmq >=1.3.0,<2.0
1111
- nlohmann_json
1212
- cppzmq
1313
- xtl

environment-wasm-host.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ dependencies:
66
- nelson >=0.3,<0.4
77
- nlohmann_json
88
- xeus-lite
9-
- xeus >=3.0.5,<4.0
9+
- xeus >=3.2.0,<4.0
1010
- xtl >=0.7,<0.8

0 commit comments

Comments
 (0)