Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[do not merge] windows and render to texture #2255

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Created by http://www.gitignore.io

.vscode
### OSX ###
.DS_Store
.AppleDouble
Expand Down
24 changes: 0 additions & 24 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,9 @@
[submodule "core/dependencies/csscolorparser"]
path = core/deps/css-color-parser-cpp
url = https://github.com/tangrams/css-color-parser-cpp
[submodule "core/include/variant"]
path = core/deps/variant
url = https://github.com/tangrams/variant
[submodule "core/include/earcut.hpp"]
path = core/deps/earcut
url = https://github.com/tangrams/earcut.hpp
[submodule "core/dependencies/geojson-vt-cpp"]
path = core/deps/geojson-vt-cpp
url = https://github.com/tangrams/geojson-vt-cpp.git
[submodule "external/duktape"]
path = core/deps/duktape
url = https://github.com/tangrams/duktape.git
[submodule "external/yaml-cpp"]
path = core/deps/yaml-cpp
url = https://github.com/tangrams/yaml-cpp
[submodule "external/glfw"]
path = platforms/common/glfw
url = https://github.com/glfw/glfw
[submodule "external/benchmark"]
path = bench/benchmark
url = https://github.com/google/benchmark
[submodule "external/alfons"]
path = core/deps/alfons
url = https://github.com/hjanetzek/alfons
[submodule "external/harfbuzz-icu-freetype"]
path = core/deps/harfbuzz-icu-freetype
url = https://github.com/tangrams/harfbuzz-icu-freetype.git
[submodule "external/SQLiteCpp"]
path = core/deps/SQLiteCpp
url = https://github.com/SRombauts/SQLiteCpp.git
100 changes: 100 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"files.associations": {
"random": "cpp",
"complex": "cpp",
"functional": "cpp",
"optional": "cpp",
"system_error": "cpp",
"type_traits": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xtr1common": "cpp",
"*.ipp": "cpp",
"string_view": "cpp",
"xstring": "cpp",
"regex": "cpp",
"sstream": "cpp",
"strstream": "cpp",
"memory": "cpp",
"variant": "cpp",
"vector": "cpp",
"xutility": "cpp",
"locale": "cpp",
"thread": "cpp",
"xlocale": "cpp",
"xlocmes": "cpp",
"xloctime": "cpp",
"array": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"queue": "cpp",
"cmath": "cpp",
"algorithm": "cpp",
"any": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"coroutine": "cpp",
"resumable": "cpp",
"filesystem": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"map": "cpp",
"memory_resource": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"set": "cpp",
"shared_mutex": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"string": "cpp",
"tuple": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"valarray": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xtree": "cpp"
}
}
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.15)

project(tangram)
project(tangram VERSION 1.0.0)

# Options
option(TANGRAM_USE_JSCORE "Use system libraries for JavaScriptCore and enable it on iOS and macOS" OFF)
Expand All @@ -18,11 +18,6 @@ option(TANGRAM_DEV_MODE "For developers only: Don't omit the frame pointer" OFF)

message(STATUS "Build type configuration: ${CMAKE_BUILD_TYPE}")

# Check that submodules are present.
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/core/deps/harfbuzz-icu-freetype/harfbuzz/README")
message(SEND_ERROR "Missing submodules - Please run:\n 'git submodule update --init'")
return()
endif()

if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DDEBUG)
Expand Down
3 changes: 3 additions & 0 deletions Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@PACKAGE_INIT@

include ( "${CMAKE_CURRENT_LIST_DIR}/TangramTargets.cmake" )
1 change: 0 additions & 1 deletion bench/benchmark
Submodule benchmark deleted from e776aa
16 changes: 0 additions & 16 deletions cmake/glfw.cmake

This file was deleted.

70 changes: 41 additions & 29 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
project(tangram-core)

# Build core library dependencies.
find_package (SQLite3)
find_package(RapidJSON CONFIG REQUIRED)
find_path(STB_INCLUDE_DIRS "stb.h")
find_package(miniz CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(yaml-cpp CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(double-conversion CONFIG REQUIRED)
if (TANGRAM_MBTILES_DATASOURCE)
## SQLiteCpp ##
###############
find_package(SQLiteCpp CONFIG REQUIRED)
endif()

find_path(MAPBOX_VARIANT_INCLUDE_DIRS "mapbox/optional.hpp")
find_path(GEOJSON_VT_CPP_INCLUDE_DIRS "mapbox/geojsonvt.hpp")
find_path(GEOJSON_CPP_INCLUDE_DIRS "mapbox/geojson.hpp")
add_subdirectory(deps)

add_library(tangram-core
Expand Down Expand Up @@ -198,44 +214,39 @@ add_library(tangram-core
# Include headers from core library and dependencies.
target_include_directories(tangram-core
PUBLIC
include/tangram
# TODO: These headers shouldn't be public, but Platform classes use them.
src
# TODO: This header shouldn't be public, but we use it in propertyItem.h
deps/variant/include
include/tangram
# TODO: These headers shouldn't be public, but Platform classes use them.
src
PRIVATE
generated
deps
deps/earcut/include
deps/isect2d/include
deps/hash-library
deps/mapbox
deps/pbf
deps/rapidjson
deps/sdf
deps/SQLiteCpp
deps/stb
deps/miniz
deps/geojson-vt-cpp/geometry.hpp/include
deps/geojson-vt-cpp/geojson.hpp/include
deps/geojson-vt-cpp/include
deps/double-conversion/include
generated
deps/mapbox
${MAPBOX_VARIANT_INCLUDE_DIRS}
${RAPIDJSON_INCLUDE_DIRS}
${GEOJSON_CPP_INCLUDE_DIRS}
${GEOJSON_VT_CPP_INCLUDE_DIRS}
)

# Link core library dependencies.
target_link_libraries(tangram-core
PRIVATE
glm
sdf
pbf
earcut
isect2d
glm::glm
css-color-parser-cpp
yaml-cpp
alfons
double-conversion
miniz
z
hashlib
double-conversion::double-conversion
miniz::miniz
#ZLIB::ZLIB
)


# Add JavaScript implementation.
if(TANGRAM_JSCORE_ENABLED)
find_package(duktape CONFIG REQUIRED)
target_sources(tangram-core PRIVATE src/js/JSCoreContext.cpp src/js/JSCoreContext.h)
if (TANGRAM_USE_JSCORE_STATIC)
target_link_libraries(tangram-core PRIVATE jscore-static)
Expand All @@ -245,13 +256,13 @@ if(TANGRAM_JSCORE_ENABLED)
target_compile_definitions(tangram-core PRIVATE TANGRAM_USE_JSCORE=1)
else()
target_sources(tangram-core PRIVATE src/js/DuktapeContext.cpp src/js/DuktapeContext.h)
target_link_libraries(tangram-core PRIVATE duktape)
target_link_libraries(tangram-core PRIVATE ${DUKTAPE_LIBRARY})
endif()

# Add MBTiles implementation.
if(TANGRAM_MBTILES_DATASOURCE)
target_sources(tangram-core PRIVATE src/data/mbtilesDataSource.cpp)
target_link_libraries(tangram-core PRIVATE SQLiteCpp sqlite3)
target_link_libraries(tangram-core PRIVATE SQLiteCpp)
target_compile_definitions(tangram-core PRIVATE TANGRAM_MBTILES_DATASOURCE=1)
endif()

Expand All @@ -260,6 +271,7 @@ if(UNIX AND NOT APPLE)
target_link_libraries(tangram-core PRIVATE dl)
endif()

target_compile_definitions(tangram-core PUBLIC _USE_MATH_DEFINES)
if(TANGRAM_WARN_ON_RULE_CONFLICT)
target_compile_definitions(tangram-core
PRIVATE
Expand All @@ -277,7 +289,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

# C++14 is required for compiling tangram-core and for using the interface headers.
set_property(TARGET tangram-core PROPERTY CXX_STANDARD 14)
set_property(TARGET tangram-core PROPERTY CXX_STANDARD 20)

# We include GLSL shader sources into the library by generating header files with the source text
# printed into a string constant. A CMake script generates one of these headers for each shader source
Expand Down
Loading