Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[build] use <experimental/optional> polyfill
Browse files Browse the repository at this point in the history
It is not available anymore in newer STL versions, e.g. according to libc++'s TS deprecation policy: https://libcxx.llvm.org/TS_deprecation.html
  • Loading branch information
kkaefer committed Oct 8, 2018
1 parent 0b36e13 commit 62c0d62
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/core.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_vendor_target(optional INTERFACE)

# Modify cmake/core-files.txt to change the source files for this target.
load_sources_list(MBGL_CORE_FILES cmake/core-files.txt)
add_library(mbgl-core STATIC ${MBGL_CORE_FILES})
Expand All @@ -7,7 +9,10 @@ target_include_directories(mbgl-core
PRIVATE src
)

target_link_libraries(mbgl-core PRIVATE codecvt)
target_link_libraries(mbgl-core
PUBLIC optional
PRIVATE codecvt
)

target_add_mason_package(mbgl-core PUBLIC geometry)
target_add_mason_package(mbgl-core PUBLIC variant)
Expand Down
4 changes: 4 additions & 0 deletions cmake/loop-darwin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ target_include_directories(mbgl-loop-darwin
PRIVATE src
)

target_link_libraries(mbgl-loop-darwin
PUBLIC optional
)

create_source_groups(mbgl-loop-darwin)

set_target_properties(mbgl-loop-darwin PROPERTIES FOLDER "Core")
Expand Down
1 change: 1 addition & 0 deletions cmake/loop-uv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ target_sources(mbgl-loop-uv INTERFACE
)

target_include_directories(mbgl-loop-uv INTERFACE
optional
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
Expand Down
13 changes: 13 additions & 0 deletions scripts/vendor/optional.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

NAME=optional
VERSION=f6249e7fdcb80131c390a083f1621d96023e72e9
ROOT=Optional-$VERSION

download "https://github.com/akrzemi1/Optional/archive/$VERSION.tar.gz"
init
extract_gzip "$ROOT/optional.hpp" "$ROOT/copyright.txt" "$ROOT/LICENSE"
mkdir -p include/experimental
mv optional.hpp include/experimental/optional
file_list include -type f
1 change: 1 addition & 0 deletions vendor/optional/files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include/experimental/optional

0 comments on commit 62c0d62

Please sign in to comment.