From 288cb1a6e6ca425c87f8fd15083f6bf14d27d30b Mon Sep 17 00:00:00 2001 From: "Lars T. Kyllingstad" Date: Thu, 22 Feb 2024 10:15:27 +0100 Subject: [PATCH] Fix build instructions --- .github/workflows/ci-conan.yml | 15 ++++++++------- README.md | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index c909693..1ca458c 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -31,23 +31,24 @@ jobs: set -eu conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force cd /mnt/source - conan install . --output-folder=build -s build_type=${{ matrix.build_type }} -o "libcosim/*:${{ matrix.option_proxyfmu }}" --build=missing - cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - cmake --build build - cmake --build build --target install + conan install . -s build_type=${{ matrix.build_type }} -o "libcosim/*:${{ matrix.option_proxyfmu }}" --build=missing + cmake -S . -B build/${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + cmake --build build/${{ matrix.build_type }} + cmake --build build/${{ matrix.build_type }} --target install EOF chmod 0777 /tmp/osp-builder-docker/entrypoint.sh - name: Build Docker image run: docker build -t osp-builder /tmp/osp-builder-docker/ - name: Build cosim run: | + chmod 0777 $(pwd) # because commands in conanio containers run as an unprivileged user mkdir -m 0777 build docker run --rm -v $(pwd):/mnt/source osp-builder - name: Upload artifact uses: actions/upload-artifact@v3 with: name: cosim-${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.compiler_version }}-${{ matrix.option_proxyfmu }} - path: build/dist + path: build/${{ matrix.build_type }}/dist windows: name: Windows @@ -71,8 +72,8 @@ jobs: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force - name: Build run: | - conan install . --output-folder=build -s build_type=${{ matrix.build_type }} -o "libcosim/*:${{ matrix.option_proxyfmu }}" --build=missing - cmake -A x64 -B build -S . "-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" + conan install . -s build_type=${{ matrix.build_type }} -o "libcosim/*:${{ matrix.option_proxyfmu }}" --build=missing + cmake -S . -B build "-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW cmake --build build --config ${{ matrix.build_type }} cmake --build build --config ${{ matrix.build_type }} --target install - name: Upload artifact diff --git a/README.md b/README.md index fcb239f..36f66f6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ conan install -s build_type=Release --build=missing . &:: Install dependencies cmake --preset=conan-default &:: Configure build system cmake --build --preset=conan-release &:: Build cmake --build --preset=conan-release --target=install &:: Install to dist/ -build/Release/dist/bin/cosim help &:: Run +build/dist/bin/cosim help &:: Run ``` In both cases, `Release` and `conan-release` can be replaced with `Debug` and `conan-debug`, respectively, if you're building for development purposes.