summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-21 16:46:49 -0800
committerKonstantin Käfer <mail@kkaefer.com>2017-03-28 13:53:19 +0200
commit321d820a87b37ecd4656b8c5adf585f2f00e09e2 (patch)
treece76fd1dcdf786ad249f36b7e70e130af1a04563 /cmake
parent306b895dadefff7af3deb390fb13e2ea12a3ebc7 (diff)
downloadqtlocation-mapboxgl-321d820a87b37ecd4656b8c5adf585f2f00e09e2.tar.gz
[node] Eliminate src as an include path
Diffstat (limited to 'cmake')
-rw-r--r--cmake/loop-darwin.cmake12
-rw-r--r--cmake/loop-uv.cmake11
-rw-r--r--cmake/node.cmake12
3 files changed, 16 insertions, 19 deletions
diff --git a/cmake/loop-darwin.cmake b/cmake/loop-darwin.cmake
index 7884c80a69..91fb74e00e 100644
--- a/cmake/loop-darwin.cmake
+++ b/cmake/loop-darwin.cmake
@@ -1,20 +1,20 @@
-add_library(mbgl-loop STATIC
+add_library(mbgl-loop-darwin STATIC
platform/darwin/src/async_task.cpp
platform/darwin/src/run_loop.cpp
platform/darwin/src/timer.cpp
)
-set_xcode_property(mbgl-loop GCC_SYMBOLS_PRIVATE_EXTERN YES)
+set_xcode_property(mbgl-loop-darwin GCC_SYMBOLS_PRIVATE_EXTERN YES)
-target_compile_options(mbgl-loop
+target_compile_options(mbgl-loop-darwin
PRIVATE -fPIC
PRIVATE -fvisibility-inlines-hidden
)
-target_include_directories(mbgl-loop
+target_include_directories(mbgl-loop-darwin
PUBLIC include
PRIVATE src
)
-create_source_groups(mbgl-loop)
-target_append_xcconfig(mbgl-loop)
+create_source_groups(mbgl-loop-darwin)
+target_append_xcconfig(mbgl-loop-darwin)
diff --git a/cmake/loop-uv.cmake b/cmake/loop-uv.cmake
index d44f43580c..9844daf205 100644
--- a/cmake/loop-uv.cmake
+++ b/cmake/loop-uv.cmake
@@ -1,19 +1,18 @@
-add_library(mbgl-loop STATIC
+add_library(mbgl-loop-uv STATIC
platform/default/async_task.cpp
platform/default/run_loop.cpp
platform/default/timer.cpp
)
-target_compile_options(mbgl-loop
+target_compile_options(mbgl-loop-uv
PRIVATE -fPIC
PRIVATE -fvisibility-inlines-hidden
)
-target_include_directories(mbgl-loop
+target_include_directories(mbgl-loop-uv
PUBLIC include
PRIVATE src
)
-target_add_mason_package(mbgl-loop PUBLIC libuv)
-
-create_source_groups(mbgl-loop)
+create_source_groups(mbgl-loop-uv)
+target_append_xcconfig(mbgl-loop-uv)
diff --git a/cmake/node.cmake b/cmake/node.cmake
index b9a4f68ecc..6833cb983f 100644
--- a/cmake/node.cmake
+++ b/cmake/node.cmake
@@ -22,12 +22,6 @@ target_sources(mbgl-node
PRIVATE platform/node/src/node_thread_pool.hpp
PRIVATE platform/node/src/node_thread_pool.cpp
PRIVATE platform/node/src/util/async_queue.hpp
-
- # We are compiling with the uv loop, but since this target already has the headers for libuv,
- # we don't have to install it manually.
- PRIVATE platform/default/async_task.cpp
- PRIVATE platform/default/run_loop.cpp
- PRIVATE platform/default/timer.cpp
)
target_compile_options(mbgl-node
@@ -36,12 +30,16 @@ target_compile_options(mbgl-node
)
target_include_directories(mbgl-node
- PRIVATE src # TODO: eliminate
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
)
target_add_mason_package(mbgl-node PRIVATE geojson)