Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
build: false

platform:
- x64

image:
- Visual Studio 2017
# TODO: enable VS2015 when tabulate can use its std::optional polyfill
# - Visual Studio 2015

environment:
matrix:
- MINICONDA: C:\\xeus-conda

init:
- "ECHO %MINICONDA%"
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" set VCVARPATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" set VCARGUMENT=%PLATFORM%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" set VCVARPATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- echo "%VCVARPATH% %VCARGUMENT%"
- "%VCVARPATH% %VCARGUMENT%"
- ps: Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe' C:\Miniconda.exe
- cmd: C:\Miniconda.exe /S /D=C:\xeus-conda
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%MINICONDA%\\Library\\bin;%PATH%"

install:
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
# Host dependencies
- conda install xeus xtl nlohmann_json cppzmq sqlite sqlitecpp cpp-tabulate=1.3 xvega xproperty -c conda-forge
# Build dependencies
- conda install cmake -c conda-forge
# Build and install xeus-python
- mkdir build
- cd build
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D XSQL_DOWNLOAD_GTEST=ON ..
- nmake
- nmake install
# Install test dependencies
- conda install pytest jupyter_kernel_test -c conda-forge

build_script:
- cd test
- test_xeus_sqlite
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ project(xeus-sqlite)
set(XEUS_SQLITE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(XEUS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test)


set(CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Expand Down Expand Up @@ -83,6 +82,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
else()
message(FATAL_ERROR "Unsupported compiler -- xeus-sqlite requires C++17 support!")
endif()
elseif (MSVC)
# std::optional used by cpp-tabulate
# TODO: drop c++17 when tabulate can fall back to the std::optional polyfill
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
endif()

# Target and link
Expand All @@ -104,7 +107,6 @@ set(XEUS_SQLITE_HEADERS
# xeus-sqlite is the target for the library
add_library(xeus-sqlite SHARED ${XEUS_SQLITE_SRC} ${XEUS_SQLITE_HEADERS})


# xsqlite is the target for the kernel executable
add_executable(xsqlite src/main.cpp)
set_target_properties(xsqlite PROPERTIES ENABLE_EXPORTS 1)
Expand Down
15 changes: 14 additions & 1 deletion src/xeus_sqlite_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/

// Define WIN32_LEAN_AND_MEAN to prevent duplicate sockets symbols.
// (Prevents Winsock.h from being included by the Windows.h header)
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#endif

#include <cctype>
#include <cstdio>
#include <fstream>
#include <memory>
#include <sstream>
#include <stack>
#include <vector>

#include "xeus/xinterpreter.hpp"
Expand All @@ -23,6 +28,14 @@
#include <SQLiteCpp/SQLiteCpp.h>
#include <SQLiteCpp/VariadicBind.h>

#if __cplusplus >= 201703L
#include <variant>
using std::variant;
#else
#include <tabulate/variant_lite.hpp>
using nonstd::variant;
#endif

namespace xeus_sqlite
{

Expand Down