Browse Source

Merge branch 'IPS-105'

master
Andreas Buff 2 weeks ago
parent
commit
48e01c3886
4 changed files with 44 additions and 9 deletions
  1. +1
    -1
      CommonPEPDependencies/CommonPEPDependencies.xcodeproj/project.pbxproj
  2. +32
    -6
      buildcode/capnp.code
  3. +2
    -1
      generate_and_run_ios_dependency_build_script.sh
  4. +9
    -1
      generate_and_run_mac_dependency_build_script.sh

+ 1
- 1
CommonPEPDependencies/CommonPEPDependencies.xcodeproj/project.pbxproj View File

@ -944,7 +944,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/bin/sh -l";
shellScript = "#LIB_NAME=\"capnp\"\n#\n#SCRIPTS_DIR=\"${PROJECT_DIR}/..\"\n#PREFIX=\"${PROJECT_DIR}/$(${SCRIPTS_DIR}/get-config-prefix.sh)\"\n#\n#BUILD_SCRIPT=\"${SCRIPTS_DIR}/generate_and_run_mac_dependency_build_script.sh\" \n#sh \"${BUILD_SCRIPT}\" $LIB_NAME \"${PREFIX}\"\n\n#tmp hack to not block others:\nTMP_DIR=\"${PROJECT_DIR}/../tmp\"\nREPO_SRC_DIR=\"${TMP_DIR}/capnproto\"\nPREFIX=\"${PROJECT_DIR}/build\"\nmkdir -p \"${PREFIX}\"\n\nif [ -f \"${PREFIX}/lib/libcapnp.a\" ]; then\n echo \"Cap'n Proto Exists Already - Nothing ToDo\"\n exit 0\nfi\n \npushd ${TMP_DIR}\n if [ ! -d \"${REPO_SRC_DIR}\" ]; then\n git clone -b \"v0.9.1\" https://github.com/capnproto/capnproto.git\n fi\npopd\n\npushd \"${REPO_SRC_DIR}/c++\"\n autoreconf -i\n ./configure --prefix=${PREFIX} --enable-static=yes --enable-shared=no\n make clean\n make -j6\n make install\npopd\n";
shellScript = "LIB_NAME=\"capnp\"\n\nSCRIPTS_DIR=\"${PROJECT_DIR}/..\"\nPREFIX=\"${PROJECT_DIR}/$(${SCRIPTS_DIR}/get-config-prefix.sh)\"\n\nBUILD_SCRIPT=\"${SCRIPTS_DIR}/generate_and_run_mac_dependency_build_script.sh\" \nsh \"${BUILD_SCRIPT}\" $LIB_NAME \"${PREFIX}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */


+ 32
- 6
buildcode/capnp.code View File

@ -12,13 +12,37 @@ if [ -f "${LIB_DIR}/${LIB_NAME}" ]; then
exit 0
fi
# We must whipe the repo. It seems to hold capnp build dependencies used in build that have been build in previous runs of make (even we `make clean`), which causes "bad CPU type" building the 2nd time for arm64.
rm -rf "${TMP_DIR}/${REPO_NAME}"
REPO_SRC_DIR="${TMP_DIR}/${REPO_NAME}/c++"
#if [ ! -d "${REPO_SRC_DIR}" ]; then
if [ ! -d "${REPO_SRC_DIR}" ]; then
git clone -b "${VERSION}" https://github.com/capnproto/capnproto.git
#fi
fi
###########################################################################
# Needed for build
# Note: this cap'n proto isntallation is only used (and MUST only be used)
# for (cross) _building_ the cap'n proto static libs (i.e. it's the
# installation used by `--with-external-capnp` in the actual builds below).
# It is *not* used (and MUST NOT be used) anywhere else.
###########################################################################
CAPNPROTO_USED_FOR_BUILD_PREFIX="${TMP_DIR}/tmpLocal"
mkdir -p "${CAPNPROTO_USED_FOR_BUILD_PREFIX}"
CPNP_BINARY_USED_FOR_BUILD="${CAPNPROTO_USED_FOR_BUILD_PREFIX}/bin/capnp"
if [ ! -f "${CPNP_BINARY_USED_FOR_BUILD}" ]; then
pushd "${REPO_SRC_DIR}"
autoreconf -i
./configure --prefix="${CAPNPROTO_USED_FOR_BUILD_PREFIX}"
make clean
make -j6
make install
popd
fi
export CAPNP=${CPNP_BINARY_USED_FOR_BUILD}
###########################################################################
# Build the actual libs
###########################################################################
export LDFLAGS="-arch ${ARCH}"
export CC="$(xcrun --sdk ${SDK} -f clang) -arch ${ARCH} -isysroot ${SDK_PATH}"
@ -26,8 +50,10 @@ export CXX="$(xcrun --sdk ${SDK} -f clang++) -arch ${ARCH} -isysroot ${SDK_PATH}
pushd ${REPO_SRC_DIR}
autoreconf -i
./configure --host=${HOST} --prefix=${CURRENT_LIB_DIR} --enable-static=yes --enable-shared=no
./configure --with-external-capnp --host=${HOST} --prefix=${CURRENT_LIB_DIR} --enable-static=yes --enable-shared=no
make clean
make -j6
make install
popd
unset CAPNP

+ 2
- 1
generate_and_run_ios_dependency_build_script.sh View File

@ -1,5 +1,6 @@
# Builds fat lib for macOS (ARM64 & x86_64).
# Generates a build script for building fat lib for iOS (ARM64 & x86_64).
# Pass PREFIX as argument. If not passed, "local/" is used as deafult.
# To generate the script the specific `buildcode/$NAME_OF_LIB_TO_BUILD.code` is merged into the commont `build-ios_dependency.template` and saved to `generated.sh`
# Exit on errors
set -e


+ 9
- 1
generate_and_run_mac_dependency_build_script.sh View File

@ -1,5 +1,6 @@
# Builds fat lib for macOS (ARM64 & x86_64).
# Generates a build script for building fat lib for macOS (ARM64 & x86_64).
# Pass PREFIX as argument. If not passed, "local/" is used as deafult.
# To generate the script the specific `buildcode/$NAME_OF_LIB_TO_BUILD.code` is merged into the commont `build-macos_dependency.template` and saved to `generated.sh`
# Exit on errors
set -e
@ -44,3 +45,10 @@ sh ${GENERATED_SCRIPT} ${PREFIX}
# Cleanup
rm -rf "${TMP_DIR}"
unset PREFIX
unset CXXFLAGS
unset CXX
unset CFLAGS
unset LDFLAGS
unset CC

Loading…
Cancel
Save