[build] switch to CMake

This is very much a work in progress.
This commit is contained in:
Konstantin Käfer
2016-06-03 18:05:04 +02:00
parent e3ee55b28d
commit 692fe1f3ff
83 changed files with 2009 additions and 2767 deletions

View File

@@ -18,6 +18,8 @@ command -v ${CLANG_TIDY} >/dev/null 2>&1 || {
cd $1
CDUP=$(git rev-parse --show-cdup)
function check_tidy() {
echo "Running clang-tidy on $0..."
if [[ -n $1 ]] && [[ $1 == "--fix" ]]; then
@@ -34,7 +36,7 @@ function check_tidy() {
function check_format() {
echo "Running clang-format on $0..."
${CLANG_FORMAT} -i ../../../$0
${CLANG_FORMAT} -i ${CDUP}/$0
}
export CLANG_TIDY CLANG_FORMAT
@@ -61,6 +63,6 @@ if [ -n $2 ] && [ $2 == "--diff" ]; then
fi
echo "All looks good!"
else
git ls-files '../../../src/mbgl/*.cpp' '../../../platform/*.cpp' '../../../test/*.cpp' | \
git ls-files '${CDUP}/src/mbgl/*.cpp' '${CDUP}/platform/*.cpp' '${CDUP}/test/*.cpp' | \
xargs -I{} -P ${JOBS} bash -c 'check_tidy' {}
fi

20
scripts/generate-core-files.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo "# Do not edit. Regenerate this with ./scripts/generate-core-files.sh" > cmake/core-files.cmake
echo "" >> cmake/core-files.cmake
echo "set(MBGL_CORE_FILES" >> cmake/core-files.cmake
PREFIX=
for FILE in $(find include src -type f -a \( -name "*.hpp" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) | perl -p -e "s/^((src|include)\/(mbgl\/)?(.+)\/\w+\.\w+)$/\$4#\$1/g" | sort) ; do
CURRENT_PREFIX="${FILE%#*}"
if [ "${PREFIX}" != "${CURRENT_PREFIX}" ]; then
if [ ! -z "${PREFIX}" ]; then echo "" >> cmake/core-files.cmake ; fi
echo " # ${CURRENT_PREFIX}" >> cmake/core-files.cmake
PREFIX="${CURRENT_PREFIX}"
fi
echo " ${FILE#*#}" >> cmake/core-files.cmake
done
echo ")" >> cmake/core-files.cmake
git diff cmake/core-files.cmake

20
scripts/generate-test-files.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo "# Do not edit. Regenerate this with ./scripts/generate-test-files.sh" > cmake/test-files.cmake
echo "" >> cmake/test-files.cmake
echo "set(MBGL_TEST_FILES" >> cmake/test-files.cmake
PREFIX=
for FILE in $(find test -type f -a \( -name "*.hpp" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) | sort) ; do
CURRENT_PREFIX=$(dirname ${FILE#test/})
if [ "${PREFIX}" != "${CURRENT_PREFIX}" ]; then
if [ ! -z "${PREFIX}" ]; then echo "" >> cmake/test-files.cmake ; fi
echo " # ${CURRENT_PREFIX}" >> cmake/test-files.cmake
PREFIX="${CURRENT_PREFIX}"
fi
echo " ${FILE}" >> cmake/test-files.cmake
done
echo ")" >> cmake/test-files.cmake
git diff cmake/test-files.cmake

View File

@@ -43,6 +43,10 @@ export DISPLAY=:99.0
mapbox_time "checkout_mason" \
git submodule update --init .mason
# Touch package.json so that we are definitely going to run an npm update action
mapbox_time "touch_package_json" \
touch package.json
# Install and set up to load a more recent version of mesa
mapbox_time "install_mesa" \
mason install mesa 11.2.2