Skip to content

Commit

Permalink
Merge pull request #49 from JohanMabille/cpp17
Browse files Browse the repository at this point in the history
Upgraded to xeus 3.2.0 and CMakeLists.txt clenaup
  • Loading branch information
JohanMabille authored Feb 21, 2024
2 parents 2680151 + 496d680 commit a1ba93c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#The full license is in the file LICENSE, distributed with this software.
#############################################################################

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.5)
project(xeus-lua)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")

Expand Down Expand Up @@ -35,9 +35,6 @@ if (NOT DEFINED XEUS_LUA_KERNELSPEC_PATH)
set(XEUS_LUA_KERNELSPEC_PATH "${CMAKE_INSTALL_FULL_BINDIR}/")
endif ()




configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels/xlua/kernel.json.in"
"${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels/xlua/kernel.json"
Expand Down Expand Up @@ -212,6 +209,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(xeus_lua_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)
Expand All @@ -222,14 +220,6 @@ macro(xeus_lua_set_common_options target_name)
CMAKE_CXX_COMPILER_ID MATCHES "Intel")

target_compile_options(${target_name} PUBLIC -Wunused-parameter -Wextra -Wreorder)

# 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-lua requires 17 support!")
endif ()
endif ()

if (APPLE)
Expand Down Expand Up @@ -375,7 +365,6 @@ endif ()
if (XEUS_LUA_BUILD_EXECUTABLE)
find_package(xeus-zmq 1.0.1 REQUIRED)
add_executable(xlua ${XEUS_LUA_MAIN_SRC})
target_compile_features(xlua PRIVATE cxx_std_17)
xeus_lua_set_common_options(xlua)
xeus_lua_set_kernel_options(xlua)
target_link_libraries(xlua PRIVATE xeus-zmq)
Expand All @@ -385,7 +374,7 @@ if(EMSCRIPTEN)
include(WasmBuildOptions)
find_package(xeus-lite REQUIRED)
add_executable(xlua src/main_emscripten_kernel.cpp )
target_link_libraries(xlua PRIVATE xeus-lite)
target_link_libraries(xlua PRIVATE xeus-lite)
target_compile_features(xlua PRIVATE cxx_std_17)
xeus_lua_set_kernel_options(xlua)
xeus_wasm_compile_options(xlua)
Expand Down
6 changes: 3 additions & 3 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ dependencies:
- cmake
- cxx-compiler
# Host dependencies
- xeus-zmq>=1.0, <2.0
- xeus-zmq>=1.3.0, <2.0
- nlohmann_json
- cppzmq
- xtl>=0.7
- lua>=5.2.0
- openlibm # [linux]
- xwidgets <0.28
- xcanvas>=0.4.1
- xwidgets <0.29
- xcanvas>=0.4.2
# to try it out
- jupyterlab
# Test dependencies
Expand Down
4 changes: 2 additions & 2 deletions environment-wasm-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- lua
- nlohmann_json
- xeus-lite
- xeus >=3.0.5,<4.0
- xeus >=3.2.0,<4.0
- xtl >=0.7,<0.8
- xcanvas >=0.4,<5.0
- xwidgets >=0.27.3,<1.0
- xwidgets >=0.27.3,<1.0

0 comments on commit a1ba93c

Please sign in to comment.