Skip to content

Commit

Permalink
Add static build on Linux to CI
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Boasson <[email protected]>
  • Loading branch information
eboasson committed Mar 12, 2024
1 parent 6dcc6e3 commit 4484f73
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .azure/templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,23 @@ steps:
cd iceoryx/build
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_BUILD_SHARED_LIBS=on \
-DCMAKE_BUILD_SHARED_LIBS=${SHAREDLIBS:-on} \
-DCMAKE_INSTALL_PREFIX=install \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ../iceoryx_meta
cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
condition: eq(variables['iceoryx'], 'on')
name: install_iceoryx
- bash: |
set -e -x
mkdir build-sharedlibs
cd build-sharedlibs
cmake -DCMAKE_INSTALL_PREFIX=install \
-DWERROR=on \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ..
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
cmake --build . --config ${BUILD_TYPE} --target package -- ${BUILD_TOOL_OPTIONS}
condition: eq(variables['sharedlibs'], 'off')
name: nonstatic_build_script
- bash: |
set -e -x
mkdir build
Expand All @@ -106,9 +117,16 @@ steps:
# Azure sometimes adds a spurious ' to BUILD_TOOL_OPTIONS
BUILD_TOOL_OPTIONS="-j 4"
fi
crosscompiling=
if [[ "${SHAREDLIBS:-on}" == "off" ]] ; then
prefix_path="${BUILD_SOURCESDIRECTORY}/build-sharedlibs/install:${prefix_path}"
crosscompiling="-DCMAKE_CROSSCOMPILING=1 -DCMAKE_SYSTEM_NAME=${AGENT_OS}"
fi
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH="${prefix_path//:/;}" \
-DBUILD_SHARED_LIBS=${SHAREDLIBS:-on} \
${crosscompiling} \
-DANALYZER=${ANALYZER:-off} \
-DSANITIZER=${SANITIZER:-none} \
-DENABLE_SSL=${SSL:-on} \
Expand Down Expand Up @@ -158,6 +176,7 @@ steps:
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" "${INSTALLPREFIX}/share/CycloneDDS/examples/helloworld"
cmake --build . --config ${BUILD_TYPE} -- ${BUILD_TOOL_OPTIONS}
${SHELL} ../../scripts/sanity_helloworld.bash
condition: ne(variables['sharedlibs'], 'off')
name: sanity_hello_world
displayName: Sanity check Hello World
- bash: |
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ jobs:
# generator: 'MinGW Makefiles'
# cc: 'C:/msys64/mingw64/bin/gcc.exe'
# cxx: 'C:/msys64/mingw64/bin/g++.exe'
'Ubuntu 22.04 LTS with default GCC (Release, Iceoryx, Static, x86_64)':
image: ubuntu-22.04
idlc_xtests: off
build_type: Release
sharedlibs: off
iceoryx: on

steps:
- template: /.azure/templates/build-test.yml
Expand Down

0 comments on commit 4484f73

Please sign in to comment.