Skip to content

Commit 9171c41

Browse files
committed
porting from gitlab
0 parents  commit 9171c41

18 files changed

+1411
-0
lines changed

.github/workflows/release.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
discussions: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
20+
- name: Install dependencies
21+
run: sudo apt-get install -y cmake build-essential
22+
23+
- name: Configure
24+
run: cmake -S . -B build
25+
26+
- name: Build
27+
run: cmake --build build --target havo -j 10
28+
29+
- name: Zip osmon std folder
30+
run: zip -r build/library.zip library
31+
32+
- name: Create Release
33+
uses: softprops/action-gh-release@v1
34+
with:
35+
files: |
36+
build/libhavo.so
37+
include/libhavo.h
38+
build/library.zip

.github/workflows/test.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test & Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest]
17+
build_type: [Release]
18+
c_compiler: [gcc, clang, cl]
19+
include:
20+
- os: windows-latest
21+
c_compiler: cl
22+
cpp_compiler: cl
23+
- os: ubuntu-latest
24+
c_compiler: gcc
25+
cpp_compiler: g++
26+
- os: ubuntu-latest
27+
c_compiler: clang
28+
cpp_compiler: clang++
29+
exclude:
30+
- os: windows-latest
31+
c_compiler: gcc
32+
- os: windows-latest
33+
c_compiler: clang
34+
- os: ubuntu-latest
35+
c_compiler: cl
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- name: Set reusable strings
41+
id: strings
42+
shell: bash
43+
run: |
44+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
45+
46+
- name: Configure CMake
47+
run: >
48+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
49+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
50+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
51+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
52+
-S ${{ github.workspace }}
53+
54+
- name: Build
55+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
56+
57+
# - name: Test
58+
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
59+
# run: ctest --build-config ${{ matrix.build_type }}

.gitignore

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
### C++ template
2+
# Prerequisites
3+
*.d
4+
5+
# Compiled Object files
6+
*.slo
7+
*.lo
8+
*.o
9+
*.obj
10+
11+
# Precompiled Headers
12+
*.gch
13+
*.pch
14+
15+
# Compiled Dynamic libraries
16+
*.so
17+
*.dylib
18+
*.dll
19+
20+
# Fortran module files
21+
*.mod
22+
*.smod
23+
24+
# Compiled Static libraries
25+
*.lai
26+
*.la
27+
*.a
28+
*.lib
29+
30+
# Executables
31+
*.exe
32+
*.out
33+
*.app
34+
35+
### C template
36+
# Prerequisites
37+
38+
# Object files
39+
*.ko
40+
*.elf
41+
42+
# Linker output
43+
*.ilk
44+
*.map
45+
*.exp
46+
47+
# Precompiled Headers
48+
49+
# Libraries
50+
51+
# Shared objects (inc. Windows DLLs)
52+
*.so.*
53+
54+
# Executables
55+
*.i*86
56+
*.x86_64
57+
*.hex
58+
59+
# Debug files
60+
*.dSYM/
61+
*.su
62+
*.idb
63+
*.pdb
64+
65+
# Kernel Module Compile Results
66+
*.mod*
67+
*.cmd
68+
.tmp_versions/
69+
modules.order
70+
Module.symvers
71+
Mkfile.old
72+
dkms.conf
73+
74+
### CMake template
75+
CMakeLists.txt.user
76+
CMakeCache.txt
77+
CMakeFiles
78+
CMakeScripts
79+
Testing
80+
Makefile
81+
cmake_install.cmake
82+
install_manifest.txt
83+
compile_commands.json
84+
CTestTestfile.cmake
85+
_deps
86+
output
87+
cmake-build-debug

CMakeLists.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.26)
2+
PROJECT(
3+
havo
4+
VERSION 0.0.3
5+
LANGUAGES C
6+
DESCRIPTION "Standard Library of Osmon"
7+
)
8+
9+
INCLUDE(GNUInstallDirs)
10+
11+
IF(NOT CMAKE_BUILD_TYPE)
12+
SET(CMAKE_BUILD_TYPE Debug)
13+
ENDIF()
14+
15+
SET(CMAKE_C_STANDARD 23)
16+
SET(BUILD_SHARED_LIBS ON)
17+
18+
SET(SOURCE_FILES
19+
source/library.c
20+
)
21+
22+
ADD_LIBRARY(havo SHARED ${SOURCE_FILES})
23+
24+
INSTALL(TARGETS havo
25+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
26+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
27+
)

0 commit comments

Comments
 (0)