From 6bedba49fa6d41cc9e1d234d6e0c1544748050d4 Mon Sep 17 00:00:00 2001 From: Tim Paine Date: Sun, 20 Jan 2019 10:25:35 -1000 Subject: [PATCH] include binding in build behind ifdef --- CMakeLists.txt | 9 +++++---- src/cpp/binding.cpp | 28 ---------------------------- src/include/perspective/binding.h | 4 ++++ 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9229eadb23..84188c0155 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,7 @@ set (SOURCE_FILES src/cpp/base_impl_osx.cpp src/cpp/base_impl_wasm.cpp src/cpp/base_impl_win.cpp + src/cpp/binding.cpp src/cpp/build_filter.cpp #src/cpp/calc_agg_dtype.cpp src/cpp/column.cpp @@ -292,13 +293,13 @@ if (PSP_WASM_BUILD) add_library(psp ${SOURCE_FILES}) set_target_properties(psp PROPERTIES COMPILE_FLAGS "${ASYNC_MODE_FLAGS}") - add_executable(perspective.async src/cpp/binding.cpp src/cpp/emscripten.cpp) + add_executable(perspective.async src/cpp/emscripten.cpp) target_link_libraries(perspective.async psp "${ASYNC_MODE_FLAGS}") set_target_properties(perspective.async PROPERTIES COMPILE_FLAGS "${ASYNC_MODE_FLAGS}") set_target_properties(perspective.async PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./build/") set_target_properties(perspective.async PROPERTIES OUTPUT_NAME "psp.async") - add_executable(perspective.sync src/cpp/binding.cpp src/cpp/emscripten.cpp) + add_executable(perspective.sync src/cpp/emscripten.cpp) target_link_libraries(perspective.sync psp "${SYNC_MODE_FLAGS}") set_target_properties(perspective.sync PROPERTIES COMPILE_FLAGS "${SYNC_MODE_FLAGS}") set_target_properties(perspective.sync PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./build/") @@ -306,7 +307,7 @@ if (PSP_WASM_BUILD) add_dependencies(perspective.sync perspective.async) if (NOT CMAKE_BUILD_TYPE_LOWER STREQUAL debug) - add_executable(perspective.asm src/cpp/binding.cpp src/cpp/emscripten.cpp) + add_executable(perspective.asm src/cpp/emscripten.cpp) target_link_libraries(perspective.asm psp "${ASMJS_MODE_FLAGS}") set_target_properties(perspective.asm PROPERTIES COMPILE_FLAGS "${ASMJS_MODE_FLAGS}") set_target_properties(perspective.asm PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./build/") @@ -324,7 +325,7 @@ else() target_link_libraries(psp ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) set(CMAKE_SHARED_LIBRARY_SUFFIX .so) - add_library(binding SHARED src/cpp/binding.cpp ${CMAKE_SOURCE_DIR}/python/perspective/src/python.cpp) + add_library(binding SHARED ${CMAKE_SOURCE_DIR}/python/perspective/src/python.cpp) target_link_libraries(binding psp) target_link_libraries(binding tbb) target_link_libraries(binding ${BOOST_PYTHON}) diff --git a/src/cpp/binding.cpp b/src/cpp/binding.cpp index 7db9d407f8..11c37c0add 100644 --- a/src/cpp/binding.cpp +++ b/src/cpp/binding.cpp @@ -6,36 +6,8 @@ * the Apache License 2.0. The full license can be found in the LICENSE file. * */ - -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef PSP_ENABLE_WASM -#include -#include -#include -#include -using namespace emscripten; -#endif - -#ifdef PSP_ENABLE_PYTHON - -#endif - using namespace perspective; - namespace perspective { namespace binding { diff --git a/src/include/perspective/binding.h b/src/include/perspective/binding.h index 16107b988a..7a36ee5a4c 100644 --- a/src/include/perspective/binding.h +++ b/src/include/perspective/binding.h @@ -8,6 +8,8 @@ */ #pragma once +#if defined(PSP_ENABLE_WASM) || defined(PSP_ENABLE_PYTHON) + #include #include #include @@ -324,3 +326,5 @@ T get_data_two_skip_headers(std::shared_ptr ctx, std::uint32_t depth, } } + +#endif \ No newline at end of file