diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-04-29 16:08:16 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-05-04 07:19:36 -0700 |
commit | e423ef5609cd738c07180d11744d4a45ffb3f82f (patch) | |
tree | 33c1da1b953206769c1fdb2c73ead51c32772070 | |
parent | 27b21363e62c105db0b040b4c5a5ef31170ebd30 (diff) | |
download | qtlocation-mapboxgl-e423ef5609cd738c07180d11744d4a45ffb3f82f.tar.gz |
[linux] Don't compile linux mbgl-loop-uv against node headers
Previously, `target_include_directories(mbgl-loop-uv PUBLIC ${NODEJS_INCLUDE_DIRS})` always applied. Compiles were working by accident because node is always installed in CI. Instead, split and inline loop-uv.cmake contents: linux uses `target_add_mason_package(mbgl-loop-uv PUBLIC libuv)`, node uses `target_include_directories(mbgl-loop-node PUBLIC ${NODEJS_INCLUDE_DIRS})`.
-rw-r--r-- | cmake/loop-uv.cmake | 18 | ||||
-rw-r--r-- | cmake/node.cmake | 22 | ||||
-rw-r--r-- | platform/linux/config.cmake | 27 | ||||
-rw-r--r-- | platform/macos/config.cmake | 1 |
4 files changed, 33 insertions, 35 deletions
diff --git a/cmake/loop-uv.cmake b/cmake/loop-uv.cmake deleted file mode 100644 index f4e7ced00e..0000000000 --- a/cmake/loop-uv.cmake +++ /dev/null @@ -1,18 +0,0 @@ -add_library(mbgl-loop-uv STATIC - platform/default/async_task.cpp - platform/default/run_loop.cpp - platform/default/timer.cpp -) - -target_include_directories(mbgl-loop-uv - PRIVATE include - PRIVATE src -) - -target_link_libraries(mbgl-loop-uv - PRIVATE mbgl-core -) - -create_source_groups(mbgl-loop-uv) - -xcode_create_scheme(TARGET mbgl-loop-uv)
\ No newline at end of file diff --git a/cmake/node.cmake b/cmake/node.cmake index 0c2f556b7d..90bec6575c 100644 --- a/cmake/node.cmake +++ b/cmake/node.cmake @@ -2,6 +2,22 @@ include(cmake/NodeJS.cmake) nodejs_init() +add_library(mbgl-loop-node STATIC + platform/default/async_task.cpp + platform/default/run_loop.cpp + platform/default/timer.cpp +) + +target_include_directories(mbgl-loop-node + PRIVATE include + PRIVATE src +) + +target_include_directories(mbgl-loop-node PUBLIC ${NODEJS_INCLUDE_DIRS}) + +create_source_groups(mbgl-loop-node) +xcode_create_scheme(TARGET mbgl-loop-node) + add_nodejs_module(mbgl-node platform/node/src/node_mapbox_gl_native.cpp ) @@ -31,13 +47,9 @@ target_include_directories(mbgl-node PRIVATE platform/default ) -# Use node-provided uv.h. This is not part of loop-uv.cmake because loop-uv.cmake is also -# used by linux/config.cmake, where we need to use headers provided by mason's libuv. -target_include_directories(mbgl-loop-uv PUBLIC ${NODEJS_INCLUDE_DIRS}) - target_link_libraries(mbgl-node PRIVATE mbgl-core - PRIVATE mbgl-loop-uv + PRIVATE mbgl-loop-node ) target_add_mason_package(mbgl-node PRIVATE geojson) diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake index dd5f0af112..53683daef0 100644 --- a/platform/linux/config.cmake +++ b/platform/linux/config.cmake @@ -11,7 +11,22 @@ mason_use(benchmark VERSION 1.2.0) mason_use(icu VERSION 58.1-min-size) mason_use(args VERSION 6.2.0 HEADER_ONLY) -include(cmake/loop-uv.cmake) +add_library(mbgl-loop-uv STATIC + platform/default/async_task.cpp + platform/default/run_loop.cpp + platform/default/timer.cpp +) + +target_include_directories(mbgl-loop-uv + PRIVATE include + PRIVATE src +) + +target_link_libraries(mbgl-loop-uv + PRIVATE mbgl-core +) + +target_add_mason_package(mbgl-loop-uv PUBLIC libuv) macro(mbgl_platform_core) target_add_mason_package(mbgl-core PUBLIC mesa) @@ -110,8 +125,6 @@ macro(mbgl_platform_glfw) PRIVATE mbgl-loop-uv ) - target_add_mason_package(mbgl-glfw PUBLIC libuv) - add_custom_command( TARGET mbgl-glfw POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy @@ -126,8 +139,6 @@ macro(mbgl_platform_render) PRIVATE mbgl-filesource PRIVATE mbgl-loop-uv ) - - target_add_mason_package(mbgl-render PUBLIC libuv) endmacro() @@ -136,8 +147,6 @@ macro(mbgl_platform_offline) PRIVATE mbgl-filesource PRIVATE mbgl-loop-uv ) - - target_add_mason_package(mbgl-offline PUBLIC libuv) endmacro() @@ -160,8 +169,6 @@ macro(mbgl_platform_test) PRIVATE mbgl-filesource PRIVATE mbgl-loop-uv ) - - target_add_mason_package(mbgl-test PUBLIC libuv) endmacro() @@ -180,8 +187,6 @@ macro(mbgl_platform_benchmark) PRIVATE mbgl-filesource PRIVATE mbgl-loop-uv ) - - target_add_mason_package(mbgl-benchmark PUBLIC libuv) endmacro() diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index e929bb55c6..28573258d9 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -6,7 +6,6 @@ mason_use(benchmark VERSION 1.2.0) mason_use(icu VERSION 58.1-min-size) mason_use(args VERSION 6.2.0 HEADER_ONLY) -include(cmake/loop-uv.cmake) include(cmake/loop-darwin.cmake) macro(mbgl_platform_core) |