- [osx] set -fvisibility-inlines-hidden in gyp/common.gypi to silence mismatched visibility linker warnings - [linux] set cxx_host in GYP_FLAGS to set -fabi-version=0 on gcc builds to use clang-built mason binaries - [ios] update symbol visibility for iOS tests - [ios] link libgeojsonvt.a in iOS tests xcodeproj - add libgeojsonvt.a to General -> Linked Frameworks and Libraries - add mason_packages (recursive) to Build Settings -> Library Search Path - [ios] add libuv and geojsonvt first in iOS libtool smush to ensure symbols are found by later compilation units where they are undefined
108 lines
2.9 KiB
Bash
Executable File
108 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
CONFIG_FILE=$1
|
|
|
|
if [ -z ${CONFIG_FILE} ]; then
|
|
abort 'You need to specify an output path for the configuration file'
|
|
fi
|
|
|
|
# Make sure we clear all colors
|
|
trap '>&2 echo -en "\033[0m"' TERM INT
|
|
|
|
function abort { >&2 echo -e "\033[1m\033[31m$1\033[0m"; exit 1; }
|
|
function info { >&2 echo -e "\033[1m\033[33m$1\033[0m"; }
|
|
function warn { >&2 echo -e "\033[1m\033[33m$1\033[0m"; }
|
|
|
|
# Install mason
|
|
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
|
|
|
|
# You can override the function for a particular set of flags by defining a
|
|
# print_XXX_flags function in your dependencies.sh file
|
|
function print_flags {
|
|
local NAME=$1; shift
|
|
if [ "$(type -t print_${NAME}_flags)" = 'function' ]; then
|
|
print_${NAME}_flags
|
|
else
|
|
local VERSION=`echo "${NAME}_VERSION" | tr "[:lower:]" "[:upper:]"`
|
|
if [ ! -z ${!VERSION:-} ] ; then
|
|
mason install ${NAME} ${!VERSION}
|
|
for FLAGS in "$@" ; do
|
|
CONFIG+=" '${NAME}_${FLAGS}%': $(quote_flags $(mason ${FLAGS} ${NAME} ${!VERSION})),"$LN
|
|
done
|
|
else
|
|
warn "* Not using ${NAME}"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
function print_default_flags {
|
|
:
|
|
}
|
|
|
|
function print_opengl_flags {
|
|
CONFIG+=" 'opengl_cflags%': [],"$LN
|
|
CONFIG+=" 'opengl_ldflags%': [],"$LN
|
|
}
|
|
|
|
# Load dependencies
|
|
source scripts/${MASON_PLATFORM}/configure.sh
|
|
if [ -e scripts/${MASON_PLATFORM}/${MASON_PLATFORM_VERSION}/configure.sh ]; then
|
|
source scripts/${MASON_PLATFORM}/${MASON_PLATFORM_VERSION}/configure.sh
|
|
fi
|
|
|
|
PYTHON=`which python || abort 'Cannot find python'`
|
|
|
|
>&2 echo -en "\033[1m\033[32m* Using "
|
|
>&2 ${PYTHON} --version
|
|
>&2 echo -en "\033[0m";
|
|
|
|
function quote_flags {
|
|
${PYTHON} -c "import sys, re; print filter(None, re.split('(?<!-framework)\s+', ' '.join(sys.argv[1:])))" "$@"
|
|
}
|
|
|
|
LN=$'\n'
|
|
|
|
CONFIG="# Do not edit. Generated by the configure script.
|
|
{
|
|
'target_defaults': {
|
|
'cflags%': [],
|
|
'default_configuration': 'Release',
|
|
'defines': [],
|
|
'include_dirs': [],
|
|
'libraries': [],
|
|
"
|
|
|
|
print_default_flags
|
|
|
|
CONFIG+=" },"$LN
|
|
CONFIG+=" 'variables': {"$LN
|
|
|
|
print_opengl_flags
|
|
|
|
print_flags boost cflags
|
|
print_flags boost_libprogram_options static_libs
|
|
print_flags openssl static_libs cflags ldflags
|
|
print_flags libcurl static_libs cflags ldflags
|
|
print_flags glfw static_libs cflags ldflags
|
|
print_flags libpng static_libs cflags ldflags
|
|
print_flags jpeg static_libs cflags ldflags
|
|
print_flags sqlite static_libs cflags ldflags
|
|
print_flags libuv static_libs cflags ldflags
|
|
print_flags zlib static_libs cflags ldflags
|
|
print_flags nunicode static_libs cflags ldflags
|
|
print_flags libzip static_libs cflags ldflags
|
|
print_flags geojsonvt static_libs cflags ldflags
|
|
print_flags variant static_libs cflags ldflags
|
|
print_flags rapidjson static_libs cflags ldflags
|
|
print_flags gtest static_libs cflags ldflags
|
|
|
|
CONFIG+=" }
|
|
}
|
|
"
|
|
|
|
mkdir -p $(dirname "${CONFIG_FILE}")
|
|
echo "${CONFIG}" > ${CONFIG_FILE}
|
|
cat ${CONFIG_FILE}
|