[build] Move the next buildsystem to the root

This will make the `next` buildsystem no longer the `next`, but the
`actual`. The idea is to simplify the build, removing scripts, to
make the platform buildsystem generated by CMake more compatible
with IDEs and make development more streamlined. It will also make
cross compilation easier.
This commit is contained in:
Thiago Marcos P. Santos
2020-02-07 16:38:14 +02:00
parent 489adb8d87
commit f7fef70e9d
33 changed files with 2653 additions and 2895 deletions

View File

@@ -0,0 +1,52 @@
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/node_modules/@mapbox/cmake-node-module/module.cmake)
message("-- Not building node bindings, dependencies not found. Run 'npm update'.")
return()
endif()
set(NODE_MODULE_CACHE_DIR ${CMAKE_SOURCE_DIR}/build/headers)
include(${PROJECT_SOURCE_DIR}/node_modules/@mapbox/cmake-node-module/module.cmake)
add_node_module(
mbgl-node
INSTALL_PATH ${PROJECT_SOURCE_DIR}/lib/{node_abi}/mbgl.node
NAN_VERSION 2.10.0
EXCLUDE_NODE_ABIS
46
47
48
51
59
67
72
79
)
target_sources(
mbgl-node
INTERFACE
${PROJECT_SOURCE_DIR}/platform/node/src/node_conversion.hpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_expression.cpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_expression.hpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_feature.cpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_feature.hpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_logging.cpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_logging.hpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_map.cpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_map.hpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_mapbox_gl_native.cpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_request.cpp
${PROJECT_SOURCE_DIR}/platform/node/src/node_request.hpp
${PROJECT_SOURCE_DIR}/platform/node/src/util/async_queue.hpp
)
target_link_libraries(
mbgl-node
INTERFACE Mapbox::Map
)
# FIXME: Node bindings only run fully on Linux now because it requires libuv RunLoop (which is the default on Linux). Also, Sanitizer will
# not work here because node will do a dlopen(), which is not currently supported.
if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT MBGL_WITH_SANITIZER)
add_test(NAME mbgl-node-memory COMMAND npm run test-memory WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_test(NAME mbgl-node-test COMMAND npm run test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif()