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 <eb@ilities.com>
  • Loading branch information
eboasson committed Mar 7, 2024
1 parent 6dcc6e3 commit 823ac28
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .azure/templates/build-test.yml
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 All @@ -125,7 +143,7 @@ steps:
-DBUILD_IDLC_XTESTS=${IDLC_XTESTS:-on} \
-DBUILD_EXAMPLES=on \
-DWERROR=on \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ..
${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}
name: script
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
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 823ac28

Please sign in to comment.