Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 24 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ name: Build On Changes

on: [pull_request]

env:
SAC2C_URL: https://gitlab.sac-home.org/sac-group/sac2c.git
INTTEST_URL: https://github.com/SacBase/IntegrationTests.git

jobs:
build-ubuntu24:
runs-on: ubuntu-24.04
steps:
- name: Get HEAD and submodules
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: 'recursive'
Expand All @@ -21,42 +25,37 @@ jobs:
sudo apt install xsltproc -y
- name: Install sac2c
run: |
git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git
git clone --single-branch --recursive ${SAC2C_URL} sac2c
cd sac2c
make release -j2
cp build_p/sac2c_p /usr/local/bin/sac2c
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RELEASE
cmake --build build -j4
ln -s $PWD/build/sac2c_p /usr/local/bin/sac2c
sac2c -V
- name: Create build dir
- name: Configure build system
run: |
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure build-system
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake -DLINKSETSIZE=200 $GITHUB_WORKSPACE
cmake -S . -B build -G Ninja
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . -j4 2>&1 | tee build.log
cmake --build build -j4 2>&1 | tee build.log
if [ ${PIPESTATUS[0]} -ne 0 ]; then
echo "!!! ERROR detected in build !!!";
exit 1;
fi
${GITHUB_WORKSPACE}/ci/fail-on-warning.sh build.log
- name: Test
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
git clone --single-branch https://github.com/SacBase/IntegrationTests.git
cd IntegrationTests
git clone --single-branch --recursive ${INTTEST_URL} inttest
cd inttest
make all
./test.sh

build-macos-arm:
runs-on: macos-latest
steps:
- name: Get HEAD and submodules
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: 'recursive'
Expand All @@ -70,33 +69,28 @@ jobs:
xcode-version: latest-stable
- name: Install sac2c
run: |
git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git
git clone --single-branch --recursive ${SAC2C_URL} sac2c
cd sac2c
make release -j2
cp build_p/sac2c_p /usr/local/bin/sac2c
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RELEASE
cmake --build build -j3
ln -s $PWD/build/sac2c_p /usr/local/bin/sac2c
sac2c -V
- name: Create build dir
- name: Configure build system
run: |
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure build-system
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake ${GITHUB_WORKSPACE}
cmake -S . -B build -G Ninja
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . -j3 2>&1 | tee build.log
cmake --build build -j3 2>&1 | tee build.log
if [ ${PIPESTATUS[0]} -ne 0 ]; then
echo "!!! ERROR detected in build !!!";
exit 1;
fi
${GITHUB_WORKSPACE}/ci/fail-on-warning.sh build.log
- name: Test
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
git clone --single-branch https://github.com/SacBase/IntegrationTests.git
cd IntegrationTests
git clone --single-branch --recursive ${INTTEST_URL} inttest
cd inttest
make all
./test.sh
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
BUILD_DIR ?= build
TARGETS ?= seq;mt_pth;seq_checks
TARGETS ?= "seq;mt_pth;seq_checks"

GENERATOR ?= "Unix Makefiles"

.PHONY: all build clean

all: build

build:
git submodule update --init --recursive
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && \
cmake -DTARGETS="$(TARGETS)" .. && $(MAKE)
cmake -S . -B $(BUILD_DIR) -G ${GENERATOR} -DTARGETS=$(TARGETS)
+cmake --build $(BUILD_DIR_RELEASE)

clean:
$(RM) -r $(BUILD_DIR)
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ To build the system one requires an operational [CMake](https://cmake.org/) >= 3

The quick and dirty option is just

```
```sh
make -j4
```

You can also use the `cmake` build system for more control
To build with Ninja, change the `GENERATOR` environment variable.

```sh
GENERATOR=Ninja make -jN
```

You can also use the `cmake` build system for more control

```sh
mkdir build
cd build
cmake <OPTIONS> ..
Expand All @@ -31,8 +37,8 @@ make -j4
**NOTE:** *When pulling the latest commit, remember to run `git submodule
update` or you will be missing changes to the `cmake-common` repository.*

> [!TIP]
> An advantage of doing a cmake build is that the generated Makefile will get targets to build individual standard library modules.
> [!TIP]
> An advantage of doing a cmake build is that the generated Makefile will get targets to build individual standard library modules.
> For instance `make seq-module-File` will then only build the File module for sequential code.

Variables that can be passed to CMake
Expand Down