From b8cd32c0d646b881db2a90ef437e42a5d3667182 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Fri, 9 Feb 2024 14:39:09 +0100 Subject: [PATCH] Upgraded to xeus-zmq 1.3.0 and CMakeLists cleanup --- CMakeLists.txt | 34 ++-------------------------------- environment-dev.yml | 2 +- environment-wasm-host.yml | 2 +- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 553480d..f33d82d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ endif () # ============ set(xtl_REQUIRED_VERSION 0.7.0) -set(xeus_REQUIRED_VERSION 3.0.5) +set(xeus_REQUIRED_VERSION 3.2.0) if (NOT TARGET xtl) find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED) @@ -74,28 +74,6 @@ endif () find_package(nelson) -# Flags -# ===== -include(CheckCXXCompilerFlag) - -if (MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4141") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4018 /wd4267 /wd4715 /wd4146 /wd4129") -endif () - -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") - if (NOT EMSCRIPTEN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-parameter -Wextra -Wreorder") - endif () - - CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP_17_FLAG) - if (HAS_CPP_17_FLAG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") - else () - message(FATAL_ERROR "Unsupported compiler -- xeus requires C++17 support!") - endif () -endif () - # Source files # ============ @@ -123,6 +101,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib; ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") macro(xnelson_set_common_options target_name) + target_compile_features(${target_name} PRIVATE cxx_std_17) if (MSVC) target_compile_options(${target_name} PUBLIC /wd4251 /wd4141) target_compile_options(${target_name} PUBLIC /wd4018 /wd4267 /wd4715 /wd4146 /wd4129) @@ -133,14 +112,6 @@ macro(xnelson_set_common_options target_name) CMAKE_CXX_COMPILER_ID MATCHES "Intel") target_compile_options(${target_name} PUBLIC -Wunused-parameter -Wextra -Wreorder) - - # C++17 flag - CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP_17_FLAG) - if (HAS_CPP_17_FLAG) - target_compile_features(${target_name} PRIVATE cxx_std_17) - else () - message(FATAL_ERROR "Unsupported compiler -- xeus-nelson requires C++17 support!") - endif () endif () if (APPLE) @@ -264,7 +235,6 @@ endif () if (XEUS_NELSON_BUILD_EXECUTABLE) find_package(xeus-zmq 1.0.2 REQUIRED) add_executable(xnelson ${XEUS_NELSON_MAIN_SRC}) - target_compile_features(xnelson PRIVATE cxx_std_17) xnelson_set_common_options(xnelson) xnelson_set_kernel_options(xnelson) target_link_libraries(xnelson PRIVATE xeus-zmq) diff --git a/environment-dev.yml b/environment-dev.yml index 079b8b8..0bbdc96 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -7,7 +7,7 @@ dependencies: - ninja - cxx-compiler # Host dependencies - - xeus-zmq >=1.0.2,<2.0 + - xeus-zmq >=1.3.0,<2.0 - nlohmann_json - cppzmq - xtl diff --git a/environment-wasm-host.yml b/environment-wasm-host.yml index 29ae77d..7317a25 100644 --- a/environment-wasm-host.yml +++ b/environment-wasm-host.yml @@ -6,5 +6,5 @@ dependencies: - nelson >=0.3,<0.4 - nlohmann_json - xeus-lite - - xeus >=3.0.5,<4.0 + - xeus >=3.2.0,<4.0 - xtl >=0.7,<0.8