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

Commit

Permalink
[build] switch to CMake
Browse files Browse the repository at this point in the history
This is very much a work in progress.
  • Loading branch information
kkaefer committed Jul 15, 2016
1 parent ac00b0d commit 5d4d83a
Show file tree
Hide file tree
Showing 82 changed files with 2,002 additions and 2,708 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ xcuserdata
/platform/ios/benchmark/assets/tiles/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6
**/token
/platform/macos/macos.xcworkspace/xcshareddata/macos.xcscmblueprint
/platform/ios/pkg
69 changes: 36 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,32 @@ git:
addons_shortcuts:
addons_clang35: &clang35
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4',
sources: [ 'ubuntu-toolchain-r-test', 'george-edison55-precise-backports' ]
packages: [ 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'cmake', 'cmake-data',
'mesa-utils', 'libxi-dev', 'libglu1-mesa-dev', 'x11proto-randr-dev', 'x11proto-xext-dev', 'libxrandr-dev',
'x11proto-xf86vidmode-dev', 'libxxf86vm-dev', 'libxcursor-dev', 'libxinerama-dev' ]
addons_gcc5: &gcc5
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'gdb', 'g++-5', 'gcc-5',
sources: [ 'ubuntu-toolchain-r-test', 'george-edison55-precise-backports' ]
packages: [ 'gdb', 'g++-5', 'gcc-5', 'cmake', 'cmake-data',
'mesa-utils', 'libxi-dev', 'libglu1-mesa-dev', 'x11proto-randr-dev', 'x11proto-xext-dev', 'libxrandr-dev',
'x11proto-xf86vidmode-dev', 'libxxf86vm-dev', 'libxcursor-dev', 'libxinerama-dev' ]
addons_qt4: &qt4
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'g++-5', 'gcc-5', 'libjemalloc-dev',
sources: [ 'ubuntu-toolchain-r-test', 'george-edison55-precise-backports' ]
packages: [ 'g++-5', 'gcc-5', 'libjemalloc-dev', 'cmake', 'cmake-data',
'mesa-utils', 'qt4-default' ]
addons_qt5: &qt5
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'g++-5', 'gcc-5',
sources: [ 'ubuntu-toolchain-r-test', 'george-edison55-precise-backports' ]
packages: [ 'g++-5', 'gcc-5', 'cmake', 'cmake-data',
'mesa-utils', 'libc6-dbg', 'qt5-default', 'libqt5opengl5-dev', 'qtdeclarative5-dev', 'qtpositioning5-dev', 'qtlocation5-dev' ]

env:
global:
- TERM: dumb
- CCACHE: 1
- CCACHE_MAXSIZE: 384M
# AWS
- secure: "MZHblLZXG/jWf2w0ZFlxCLDwx2qtGgRDODQyg1BR7JIuMz6AtWv8XR/sUczWLbiABCL0a/NzJF1g4v2pI7X69IntcjOdIABBgTh7++6+1TJ0Kp8viEltb55nQG3lHy/R6fOaI7Pj9tuCX0PCRtGA5C/fGnodLGEjy3RVOJ09ln0="
- secure: "KaSQbhgjtV7ZCkesHmvrNsbQVjk5SPfGKB1VkWenRGYhLF45HpSRNwSxMQddZ566Pg7qIFgF1iWl/B0QW3B6AWL5WmzQ5AOJgwS876pNIc/UT7ubMPtgAtjpvw1bQvQP3B8MrB+3OE5c6tD+a3LhR9krV//dOsfErR5Yy+3Mbkc="
Expand All @@ -41,6 +42,7 @@ install:
- source ./scripts/travis_setup.sh
before_script:
- ccache --zero-stats
- cmake --version
script:
- make linux
- make test-linux
Expand Down Expand Up @@ -115,37 +117,38 @@ matrix:
script:
- make tidy

# Qt 4 - Release
- os: linux
sudo: required
dist: trusty
language: cpp
compiler: "qt4-gcc5-release"
env: BUILDTYPE=Release _CXX=g++-5 _CC=gcc-5
addons: *qt4
script:
- make qt-app
- LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so make test-qt-Memory.*:*.Load
# # Qt 4 - Release
# - os: linux
# sudo: required
# dist: trusty
# language: cpp
# compiler: "qt4-gcc5-release"
# env: BUILDTYPE=Release _CXX=g++-5 _CC=gcc-5
# addons: *qt4
# script:
# - make qt-app
# - LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so make test-qt-Memory.*:*.Load

# Qt 5 - Release
- os: linux
sudo: required
dist: trusty
language: cpp
compiler: "qt5-gcc5-release"
env: BUILDTYPE=Release _CXX=g++-5 _CC=gcc-5
addons: *qt5
script:
- make qt-app
- make qt-qml-app
- make test-valgrind-qt--*.Load
# # Qt 5 - Release
# - os: linux
# sudo: required
# dist: trusty
# language: cpp
# compiler: "qt5-gcc5-release"
# env: BUILDTYPE=Release _CXX=g++-5 _CC=gcc-5
# addons: *qt5
# script:
# - make qt-app
# - make qt-qml-app
# - make test-valgrind-qt--*.Load

cache:
directories:
- $HOME/.ccache
- $HOME/.cache/pip
- $HOME/build/mapbox/mapbox-gl-native/.binaries
- $HOME/build/mapbox/mapbox-gl-native/.scripts
- .mason
- node_modules
- mason_packages/.binaries

notifications:
slack:
Expand Down
51 changes: 51 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
cmake_minimum_required(VERSION 3.2)
project(mbgl LANGUAGES CXX C)
include(cmake/npm.cmake)
include(cmake/mason.cmake)
include(cmake/mbgl.cmake)

mason_use(geometry 0.8.0)
mason_use(variant 1.1.0)
mason_use(unique_resource dev)
mason_use(rapidjson 1.0.2)
mason_use(boost 1.60.0)
mason_use(geojson 0.1.4)
mason_use(geojsonvt 6.1.0)
mason_use(earcut 0.11)
mason_use(protozero 1.3.0)
mason_use(gtest 1.7.0)
mason_use(pixelmatch 0.9.0)

set(CMAKE_CONFIGURATION_TYPES Debug Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Wshadow -Wno-variadic-macros -Wno-unknown-pragmas")

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(platform/${MBGL_PLATFORM}/config.cmake)

include(cmake/core-files.cmake)
include(cmake/shaders.cmake)
include(cmake/core.cmake)

if(COMMAND mbgl_platform_test)
include(cmake/test-files.cmake)
include(cmake/test.cmake)
endif()

if(COMMAND mbgl_platform_glfw)
include(cmake/glfw.cmake)
endif()

if(COMMAND mbgl_platform_render)
include(cmake/render.cmake)
endif()

if(COMMAND mbgl_platform_offline)
include(cmake/offline.cmake)
endif()

if(COMMAND mbgl_platform_node)
include(cmake/node.cmake)
endif()
Loading

0 comments on commit 5d4d83a

Please sign in to comment.