summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-02-26 16:08:23 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-02-27 18:19:31 +0200
commit427d785848ba1cbf8df095ebe75c8731f30dfb5e (patch)
tree317eb2ba3ba7078f13f00cd83a0368d76f6b949f
parent242b719f0cbb24b485e439edd0da5aedee87f444 (diff)
downloadqtlocation-mapboxgl-427d785848ba1cbf8df095ebe75c8731f30dfb5e.tar.gz
[build] Make csscolorparser and parsedate vendors
They have a different license from the rest of the code and this will make it explicit. Also the script for generating the license will dectect them correctly.
-rw-r--r--CMakeLists.txt10
-rw-r--r--platform/android/android.cmake16
-rw-r--r--platform/ios/ios.cmake2
-rw-r--r--vendor/csscolorparser.cmake27
-rw-r--r--vendor/csscolorparser/LICENSE20
-rw-r--r--vendor/csscolorparser/csscolorparser.cpp (renamed from src/csscolorparser/csscolorparser.cpp)4
-rw-r--r--vendor/csscolorparser/csscolorparser/csscolorparser.hpp (renamed from src/csscolorparser/csscolorparser.hpp)4
-rw-r--r--vendor/parsedate.cmake27
-rw-r--r--vendor/parsedate/COPYING22
-rw-r--r--vendor/parsedate/parsedate.cpp (renamed from src/parsedate/parsedate.cpp)4
-rw-r--r--vendor/parsedate/parsedate/parsedate.hpp (renamed from src/parsedate/parsedate.hpp)0
11 files changed, 114 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca0fbefa74..4b7c98eac3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -265,8 +265,6 @@ add_library(
${PROJECT_SOURCE_DIR}/include/mbgl/util/work_request.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/work_task.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/work_task_impl.hpp
- ${PROJECT_SOURCE_DIR}/src/csscolorparser/csscolorparser.cpp
- ${PROJECT_SOURCE_DIR}/src/csscolorparser/csscolorparser.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/actor/mailbox.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/actor/scheduler.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/algorithm/update_renderables.hpp
@@ -799,8 +797,6 @@ add_library(
${PROJECT_SOURCE_DIR}/src/mbgl/util/version.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/version.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/work_request.cpp
- ${PROJECT_SOURCE_DIR}/src/parsedate/parsedate.cpp
- ${PROJECT_SOURCE_DIR}/src/parsedate/parsedate.hpp
)
if(MBGL_WITH_OPENGL)
@@ -933,10 +929,12 @@ target_include_directories(
PUBLIC ${PROJECT_SOURCE_DIR}/include
)
-include(${PROJECT_SOURCE_DIR}/vendor/mapbox-base.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/boost.cmake)
+include(${PROJECT_SOURCE_DIR}/vendor/csscolorparser.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/earcut.hpp.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/eternal.cmake)
+include(${PROJECT_SOURCE_DIR}/vendor/mapbox-base.cmake)
+include(${PROJECT_SOURCE_DIR}/vendor/parsedate.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/polylabel.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/protozero.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/unique_resource.cmake)
@@ -952,8 +950,10 @@ target_link_libraries(
Mapbox::Base::geojson-vt-cpp
mbgl-compiler-options
mbgl-vendor-boost
+ mbgl-vendor-csscolorparser
mbgl-vendor-earcut.hpp
mbgl-vendor-eternal
+ mbgl-vendor-parsedate
mbgl-vendor-polylabel
mbgl-vendor-protozero
mbgl-vendor-unique_resource
diff --git a/platform/android/android.cmake b/platform/android/android.cmake
index fafaefd264..1fbe67836d 100644
--- a/platform/android/android.cmake
+++ b/platform/android/android.cmake
@@ -10,17 +10,13 @@ target_compile_definitions(
include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/sqlite.cmake)
+# cmake-format: off
+target_compile_options(mbgl-vendor-csscolorparser PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>)
target_compile_options(mbgl-vendor-icu PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>)
-
-target_compile_options(
- mbgl-vendor-sqlite
- PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>
-)
-
-target_compile_options(
- mbgl-compiler-options
- INTERFACE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>
-)
+target_compile_options(mbgl-vendor-parsedate PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>)
+target_compile_options(mbgl-vendor-sqlite PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>)
+target_compile_options(mbgl-compiler-options INTERFACE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>)
+# cmake-format: on
target_link_libraries(
mbgl-compiler-options
diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake
index f27196c580..91489dbba9 100644
--- a/platform/ios/ios.cmake
+++ b/platform/ios/ios.cmake
@@ -80,7 +80,9 @@ include(${PROJECT_SOURCE_DIR}/platform/ios/ccache.cmake)
include(${PROJECT_SOURCE_DIR}/platform/ios/ios-test-runners.cmake)
initialize_ios_target(mbgl-core)
+initialize_ios_target(mbgl-vendor-csscolorparser)
initialize_ios_target(mbgl-vendor-icu)
+initialize_ios_target(mbgl-vendor-parsedate)
target_link_libraries(
mbgl-core
diff --git a/vendor/csscolorparser.cmake b/vendor/csscolorparser.cmake
new file mode 100644
index 0000000000..28038ff988
--- /dev/null
+++ b/vendor/csscolorparser.cmake
@@ -0,0 +1,27 @@
+if(TARGET mbgl-vendor-csscolorparser)
+ return()
+endif()
+
+add_library(
+ mbgl-vendor-csscolorparser STATIC
+ ${CMAKE_CURRENT_LIST_DIR}/csscolorparser/csscolorparser.cpp
+)
+
+target_link_libraries(
+ mbgl-vendor-csscolorparser
+ PRIVATE Mapbox::Base::optional mbgl-compiler-options
+)
+
+target_include_directories(
+ mbgl-vendor-csscolorparser SYSTEM
+ PUBLIC ${CMAKE_CURRENT_LIST_DIR}/csscolorparser
+)
+
+set_target_properties(
+ mbgl-vendor-csscolorparser
+ PROPERTIES
+ INTERFACE_MAPBOX_NAME "csscolorparser"
+ INTERFACE_MAPBOX_URL "https://github.com/mapbox/css-color-parser-cpp"
+ INTERFACE_MAPBOX_AUTHOR "Dean McNamee and Konstantin Käfer"
+ INTERFACE_MAPBOX_LICENSE ${CMAKE_CURRENT_LIST_DIR}/csscolorparser/LICENSE
+)
diff --git a/vendor/csscolorparser/LICENSE b/vendor/csscolorparser/LICENSE
new file mode 100644
index 0000000000..2408b4a02e
--- /dev/null
+++ b/vendor/csscolorparser/LICENSE
@@ -0,0 +1,20 @@
+(c) Dean McNamee <dean@gmail.com>, 2012.
+(c) Konstantin Käfer <mail@kkaefer.com>, 2014.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/src/csscolorparser/csscolorparser.cpp b/vendor/csscolorparser/csscolorparser.cpp
index 0de921b265..b0ff5f84e0 100644
--- a/src/csscolorparser/csscolorparser.cpp
+++ b/vendor/csscolorparser/csscolorparser.cpp
@@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
-#include "csscolorparser.hpp"
+#include "csscolorparser/csscolorparser.hpp"
#include <cstdint>
#include <vector>
@@ -176,7 +176,7 @@ std::vector<std::string> split(const std::string& s, char delim) {
return elems;
}
-mbgl::optional<Color> parse(const std::string& css_str) {
+std::experimental::optional<Color> parse(const std::string& css_str) {
std::string str = css_str;
// Remove all whitespace, not compliant, but should just be more accepting.
diff --git a/src/csscolorparser/csscolorparser.hpp b/vendor/csscolorparser/csscolorparser/csscolorparser.hpp
index 88b916620e..30b308022a 100644
--- a/src/csscolorparser/csscolorparser.hpp
+++ b/vendor/csscolorparser/csscolorparser/csscolorparser.hpp
@@ -25,7 +25,7 @@
#ifndef CSS_COLOR_PARSER_CPP
#define CSS_COLOR_PARSER_CPP
-#include <mbgl/util/optional.hpp>
+#include <optional.hpp>
#include <string>
#include <cmath>
@@ -50,7 +50,7 @@ inline bool operator!=(const Color& lhs, const Color& rhs) {
return !(lhs == rhs);
}
-mbgl::optional<Color> parse(const std::string& css_str);
+std::experimental::optional<Color> parse(const std::string& css_str);
} // namespace CSSColorParser
diff --git a/vendor/parsedate.cmake b/vendor/parsedate.cmake
new file mode 100644
index 0000000000..fe1163ce07
--- /dev/null
+++ b/vendor/parsedate.cmake
@@ -0,0 +1,27 @@
+if(TARGET mbgl-vendor-parsedate)
+ return()
+endif()
+
+add_library(
+ mbgl-vendor-parsedate STATIC
+ ${CMAKE_CURRENT_LIST_DIR}/parsedate/parsedate.cpp
+)
+
+target_link_libraries(
+ mbgl-vendor-parsedate
+ PRIVATE mbgl-compiler-options
+)
+
+target_include_directories(
+ mbgl-vendor-parsedate SYSTEM
+ PUBLIC ${CMAKE_CURRENT_LIST_DIR}/parsedate
+)
+
+set_target_properties(
+ mbgl-vendor-parsedate
+ PROPERTIES
+ INTERFACE_MAPBOX_NAME "parsedate"
+ INTERFACE_MAPBOX_URL "https://curl.haxx.se"
+ INTERFACE_MAPBOX_AUTHOR "Daniel Stenberg and others"
+ INTERFACE_MAPBOX_LICENSE ${CMAKE_CURRENT_LIST_DIR}/parsedate/COPYING
+)
diff --git a/vendor/parsedate/COPYING b/vendor/parsedate/COPYING
new file mode 100644
index 0000000000..9d9e4af8d8
--- /dev/null
+++ b/vendor/parsedate/COPYING
@@ -0,0 +1,22 @@
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1996 - 2020, Daniel Stenberg, <daniel@haxx.se>, and many
+contributors, see the THANKS file.
+
+All rights reserved.
+
+Permission to use, copy, modify, and distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright
+notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not
+be used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization of the copyright holder.
diff --git a/src/parsedate/parsedate.cpp b/vendor/parsedate/parsedate.cpp
index 194b83780b..6531cd6dff 100644
--- a/src/parsedate/parsedate.cpp
+++ b/vendor/parsedate/parsedate.cpp
@@ -73,9 +73,7 @@
*/
-#include "parsedate.hpp"
-
-
+#include "parsedate/parsedate.hpp"
#ifdef __cplusplus
extern "C" {
diff --git a/src/parsedate/parsedate.hpp b/vendor/parsedate/parsedate/parsedate.hpp
index 40bfccb7a0..40bfccb7a0 100644
--- a/src/parsedate/parsedate.hpp
+++ b/vendor/parsedate/parsedate/parsedate.hpp