summaryrefslogtreecommitdiff
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
parent306b895dadefff7af3deb390fb13e2ea12a3ebc7 (diff)
downloadqtlocation-mapboxgl-321d820a87b37ecd4656b8c5adf585f2f00e09e2.tar.gz
[node] Eliminate src as an include path
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/loop-darwin.cmake12
-rw-r--r--cmake/loop-uv.cmake11
-rw-r--r--cmake/node.cmake12
-rw-r--r--platform/linux/config.cmake14
-rw-r--r--platform/macos/config.cmake10
-rw-r--r--platform/macos/macos.xcodeproj/project.pbxproj22
7 files changed, 43 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49f3443d9e..480c186057 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,6 +78,8 @@ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/platform/${MBGL_PLATFORM}/config.cmake)
message(ERROR "Can't find config.cmake file for platform ${MBGL_PLATFORM}")
endif()
+include(cmake/loop-uv.cmake)
+
include(platform/${MBGL_PLATFORM}/config.cmake)
include(cmake/core-files.cmake)
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)
diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake
index ff2dcf4cfa..97928a0e93 100644
--- a/platform/linux/config.cmake
+++ b/platform/linux/config.cmake
@@ -11,7 +11,9 @@ mason_use(gtest VERSION 1.8.0${MASON_CXXABI_SUFFIX})
mason_use(benchmark VERSION 1.0.0-1)
mason_use(icu VERSION 58.1-min-size)
-include(cmake/loop-uv.cmake)
+# Link with libuv. This is not part of loop-uv.cmake because loop-uv.cmake is also
+# used by node.cmake, where we want to link with the libuv provided by node itself.
+target_add_mason_package(mbgl-loop-uv PUBLIC libuv)
macro(mbgl_platform_core)
target_add_mason_package(mbgl-core PUBLIC mesa)
@@ -108,7 +110,7 @@ endmacro()
macro(mbgl_platform_glfw)
target_link_libraries(mbgl-glfw
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-uv
)
add_custom_command(
@@ -122,14 +124,14 @@ endmacro()
macro(mbgl_platform_render)
target_link_libraries(mbgl-render
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-uv
)
endmacro()
macro(mbgl_platform_offline)
target_link_libraries(mbgl-offline
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-uv
)
endmacro()
@@ -146,7 +148,7 @@ macro(mbgl_platform_test)
)
target_link_libraries(mbgl-test
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-uv
)
endmacro()
@@ -163,7 +165,7 @@ macro(mbgl_platform_benchmark)
)
target_link_libraries(mbgl-benchmark
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-uv
)
endmacro()
diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake
index cbaf3d492e..0dc9141114 100644
--- a/platform/macos/config.cmake
+++ b/platform/macos/config.cmake
@@ -81,7 +81,7 @@ endmacro()
macro(mbgl_platform_glfw)
target_link_libraries(mbgl-glfw
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-darwin
PRIVATE "-framework OpenGL"
PRIVATE "-lsqlite3"
)
@@ -90,7 +90,7 @@ endmacro()
macro(mbgl_platform_render)
target_link_libraries(mbgl-render
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-darwin
PRIVATE "-framework Foundation"
PRIVATE "-framework CoreGraphics"
PRIVATE "-framework OpenGL"
@@ -103,7 +103,7 @@ endmacro()
macro(mbgl_platform_offline)
target_link_libraries(mbgl-offline
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-darwin
PRIVATE "-framework Foundation"
PRIVATE "-framework CoreGraphics"
PRIVATE "-framework OpenGL"
@@ -130,7 +130,7 @@ macro(mbgl_platform_test)
)
target_link_libraries(mbgl-test
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-darwin
PRIVATE "-framework Foundation"
PRIVATE "-framework CoreGraphics"
PRIVATE "-framework OpenGL"
@@ -156,7 +156,7 @@ macro(mbgl_platform_benchmark)
)
target_link_libraries(mbgl-benchmark
- PRIVATE mbgl-loop
+ PRIVATE mbgl-loop-darwin
PRIVATE "-framework Foundation"
PRIVATE "-framework CoreGraphics"
PRIVATE "-framework OpenGL"
diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj
index 0db0acb5b0..3f6b56ef4f 100644
--- a/platform/macos/macos.xcodeproj/project.pbxproj
+++ b/platform/macos/macos.xcodeproj/project.pbxproj
@@ -62,13 +62,14 @@
40B77E451DB11BC9003DA2FE /* NSArray+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */; };
40B77E461DB11BCD003DA2FE /* NSArray+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40B77E421DB11BB0003DA2FE /* NSArray+MGLAdditions.mm */; };
40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */; };
+ 52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; };
+ 52B5D1801E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; };
52BECB0A1CC5A26F009CD791 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */; };
5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; };
556660C61E1BEA0100E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C51E1BEA0100E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; };
556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */; };
558DE7A61E56161C00C7916D /* MGLFoundation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */; };
558DE7A71E56161C00C7916D /* MGLFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE7A51E56161C00C7916D /* MGLFoundation.mm */; };
- 558F18221D0B13B100123F46 /* libmbgl-loop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 558F18211D0B13B000123F46 /* libmbgl-loop.a */; };
55D9B4B11D005D3900C1CCE2 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D9B4B01D005D3900C1CCE2 /* libz.tbd */; };
55E2AD111E5B0A6900E8C587 /* MGLOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */; };
920A3E591E6F859D00C16EFC /* MGLSourceQueryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 920A3E581E6F859D00C16EFC /* MGLSourceQueryTests.m */; };
@@ -137,7 +138,6 @@
DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */; };
DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */; };
DA8F25B31D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */; };
- DAA1BB4A1E2D425C00ABB750 /* libmbgl-loop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA1BB491E2D425C00ABB750 /* libmbgl-loop.a */; };
DAA48EFD1D6A4731006A7E36 /* StyleLayerIconTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA48EFC1D6A4731006A7E36 /* StyleLayerIconTransformer.m */; };
DAB2CCE51DF632ED001B2FE1 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB2CCE41DF632ED001B2FE1 /* LimeGreenStyleLayer.m */; };
DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */; };
@@ -324,13 +324,11 @@
40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayerTests.h; sourceTree = "<group>"; };
40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerTests.m; sourceTree = "<group>"; };
52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
- 5548BE791D0ACBB2005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; };
5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; };
556660C51E1BEA0100E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = "<group>"; };
556660D51E1D07E400E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = "<group>"; };
558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFoundation_Private.h; sourceTree = "<group>"; };
558DE7A51E56161C00C7916D /* MGLFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFoundation.mm; sourceTree = "<group>"; };
- 558F18211D0B13B000123F46 /* libmbgl-loop.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop.a"; path = "../../build/osx/Debug/libmbgl-loop.a"; sourceTree = "<group>"; };
55D9B4B01D005D3900C1CCE2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLOfflineStorageTests.mm; path = ../../darwin/test/MGLOfflineStorageTests.mm; sourceTree = "<group>"; };
55FE0E8D1D100A0900FD240B /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = config.xcconfig; path = ../../build/macos/config.xcconfig; sourceTree = "<group>"; };
@@ -442,7 +440,6 @@
DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.mm.ejs; sourceTree = "<group>"; };
DA9C01301E4C7B9300C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "pt-BR"; path = "pt-BR.lproj/Foundation.stringsdict"; sourceTree = "<group>"; };
DA9C01311E4C7B9F00C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
- DAA1BB491E2D425C00ABB750 /* libmbgl-loop.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop.a"; path = "../../build/macos/Debug/libmbgl-loop.a"; sourceTree = "<group>"; };
DAA32CA61E4C4849006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
DAA32CA71E4C486D006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Foundation.strings; sourceTree = "<group>"; };
DAA32CA81E4C48B9006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = de; path = de.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
@@ -578,8 +575,8 @@
files = (
52BECB0A1CC5A26F009CD791 /* SystemConfiguration.framework in Frameworks */,
5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */,
- 558F18221D0B13B100123F46 /* libmbgl-loop.a in Frameworks */,
DAE6C3C71CC3499100DB3429 /* libsqlite3.tbd in Frameworks */,
+ 52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */,
55D9B4B11D005D3900C1CCE2 /* libz.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -588,9 +585,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- DAA1BB4A1E2D425C00ABB750 /* libmbgl-loop.a in Frameworks */,
DAE0DD7A1D5F015A005A6BB1 /* libmbgl-core.a in Frameworks */,
DAE6C3321CC30DB200DB3429 /* Mapbox.framework in Frameworks */,
+ 52B5D1801E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -924,10 +921,7 @@
DAE6C31E1CC308BC00DB3429 /* Frameworks */ = {
isa = PBXGroup;
children = (
- DAA1BB491E2D425C00ABB750 /* libmbgl-loop.a */,
- 558F18211D0B13B000123F46 /* libmbgl-loop.a */,
5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */,
- 5548BE791D0ACBB2005DDE81 /* libmbgl-loop-darwin.a */,
55D9B4B01D005D3900C1CCE2 /* libz.tbd */,
52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */,
DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */,
@@ -1738,6 +1732,10 @@
INFOPLIST_FILE = "$(SRCROOT)/sdk/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/cmake/Debug",
+ );
OTHER_CFLAGS = "-fvisibility=hidden";
OTHER_LDFLAGS = (
"$(mbgl_core_LINK_LIBRARIES)",
@@ -1794,6 +1792,10 @@
HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
INFOPLIST_FILE = test/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/cmake/Debug",
+ );
OTHER_CFLAGS = "-fvisibility=hidden";
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",