-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ubuntu Azure Pipelines jobs. Add some caching.
- Loading branch information
Showing
9 changed files
with
494 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
vcpkg_base_dir=$1 | ||
vcpkg_tag=$2 | ||
|
||
cd ${vcpkg_base_dir} | ||
git clone https://github.com/Microsoft/vcpkg.git | ||
git -C ${vcpkg_base_dir}/vcpkg checkout ${vcpkg_tag} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
vcpkg_base_dir=$1 | ||
shift | ||
vcpkg_libraries=$@ | ||
|
||
echo "vcpkg_base_dir=${vcpkg_base_dir}" | ||
echo "vcpkg_libraries=${vcpkg_libraries}" | ||
|
||
export BOOST_MODULAR_CMAKE="${vcpkg_base_dir}/vcpkg/ports/boost-modular-build-helper/CMakeLists.txt" | ||
export LN=$(grep -n "WORKING_DIRECTORY" ${BOOST_MODULAR_CMAKE} | awk -F ":" '{print $1}') | ||
gsed -i "${LN}i\ cxxstd=17" ${BOOST_MODULAR_CMAKE} | ||
|
||
${vcpkg_base_dir}/vcpkg/bootstrap-vcpkg.sh | ||
${vcpkg_base_dir}/vcpkg/vcpkg install ${vcpkg_libraries} | ||
rm -rf ${vcpkg_base_dir}/vcpkg/buildtrees | ||
rm -rf ${vcpkg_base_dir}/vcpkg/downloads | ||
rm -rf ${vcpkg_base_dir}/vcpkg/packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
selene_dir=$(pwd) | ||
|
||
echo "--------------------------------------------------" | ||
echo "COMMIT $(git rev-parse HEAD)" | ||
echo "--------------------------------------------------" | ||
echo "CC = ${CC}" | ||
echo "CXX = ${CXX}" | ||
echo "CXXFLAGS = ${CXXFLAGS}" | ||
echo "LDFLAGS = ${LDFLAGS}" | ||
echo "" | ||
echo "VCPKG_DIR = ${VCPKG_DIR}" | ||
echo "BUILD_TYPE = " ${BUILD_TYPE} | ||
echo "ASAN = ${ASAN}" | ||
echo "--------------------------------------------------" | ||
cmake --version; | ||
echo "--------------------------------------------------" | ||
${CC} --version; | ||
echo "--------------------------------------------------" | ||
${CXX} --version; | ||
echo "--------------------------------------------------" | ||
|
||
local_build_benchmarks="-DSELENE_BUILD_BENCHMARKS=OFF" | ||
|
||
if [[ -n "${VCPKG_DIR}" ]]; then | ||
echo "Building using vcpkg..." | ||
local_vcpkg_toolchain="-DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake" | ||
full_vcpkg_dir=${VCPKG_DIR} | ||
local_build_benchmarks="-DSELENE_BUILD_BENCHMARKS=ON" | ||
fi | ||
|
||
if [[ -n "${BUILD_TYPE}" ]]; then | ||
echo "Build type: ${BUILD_TYPE}" | ||
local_build_type="-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" | ||
fi | ||
|
||
if [[ -n "${ASAN}" ]]; then | ||
echo "Building with AddressSanitizer enabled..." | ||
local_enable_sanitizers="-DSELENE_ENABLE_SANITIZERS=ON" | ||
fi | ||
|
||
# CMake invocation | ||
rm -rf build && mkdir -p build && cd build | ||
cmake -G Ninja \ | ||
${local_vcpkg_toolchain} \ | ||
${local_build_type} \ | ||
${local_enable_sanitizers} \ | ||
-DSELENE_BUILD_TESTS=ON \ | ||
-DSELENE_BUILD_EXAMPLES=ON \ | ||
${local_build_benchmarks} \ | ||
-DSELENE_WARNINGS_AS_ERRORS=ON \ | ||
.. | ||
|
||
echo "--------------------------------------------------" | ||
echo "Build all targets..." | ||
|
||
cmake --build . -j | ||
export SELENE_DATA_PATH=${selene_dir}/data | ||
|
||
echo "--------------------------------------------------" | ||
echo "Run tests..." | ||
|
||
./test/selene_tests -d yes | ||
|
||
echo "--------------------------------------------------" | ||
echo "Run all example binaries..." | ||
|
||
# Run all example binaries | ||
# https://stackoverflow.com/questions/4458120/unix-find-search-for-executable-files | ||
example_binaries=$(find -L ./examples/ -maxdepth 1 -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \)) | ||
for file in ${example_binaries} | ||
do | ||
echo "EXECUTING ${file}..." | ||
${file} | ||
done | ||
|
||
echo "--------------------------------------------------" | ||
|
||
if [[ -n "${VCPKG_DIR}" ]]; then | ||
echo "Build an example project using a vcpkg-installed version of Selene..." | ||
echo "- Copying portfiles" | ||
cp ${selene_dir}/package/vcpkg/* ${full_vcpkg_dir}/ports/selene | ||
|
||
echo "- Removing selene (shouldn't exist)" | ||
${full_vcpkg_dir}/vcpkg remove selene | ||
echo "- Installing selene from HEAD" | ||
${full_vcpkg_dir}/vcpkg install --head selene | ||
|
||
echo "- Invoking CMake on test project" | ||
cd ${selene_dir}/package/test_vcpkg | ||
rm -rf build && mkdir -p build && cd build | ||
cmake -G Ninja ${local_vcpkg_toolchain} .. | ||
|
||
echo "- Building test project" | ||
cmake --build . -j | ||
|
||
echo "- Running test project" | ||
./example | ||
fi | ||
|
||
echo "--------------------------------------------------" | ||
|
||
echo "FINISHED." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
vcpkg_base_dir=$1 | ||
vcpkg_tag=$2 | ||
|
||
cd ${vcpkg_base_dir} | ||
git clone https://github.com/Microsoft/vcpkg.git | ||
git -C ${vcpkg_base_dir}/vcpkg checkout ${vcpkg_tag} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
vcpkg_base_dir=$1 | ||
shift | ||
vcpkg_libraries=$@ | ||
|
||
echo "vcpkg_base_dir=${vcpkg_base_dir}" | ||
echo "vcpkg_libraries=${vcpkg_libraries}" | ||
echo "CC=${CC}" | ||
echo "CXX=${CXX}" | ||
echo "CXXFLAGS=${CXXFLAGS}" | ||
echo "LDFLAGS=${LDFLAGS}" | ||
|
||
CC=gcc-8 CXX=g++-8 CXXFLAGS="" LDFLAGS="" ${vcpkg_base_dir}/vcpkg/bootstrap-vcpkg.sh | ||
${vcpkg_base_dir}/vcpkg/vcpkg install ${vcpkg_libraries} | ||
rm -rf ${vcpkg_base_dir}/vcpkg/buildtrees | ||
rm -rf ${vcpkg_base_dir}/vcpkg/downloads | ||
rm -rf ${vcpkg_base_dir}/vcpkg/packages |
Oops, something went wrong.