Skip to content

Commit

Permalink
porting from gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Aug 3, 2024
0 parents commit 9171c41
Show file tree
Hide file tree
Showing 18 changed files with 1,411 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Release

on:
push:
tags:
- '*'

permissions:
contents: write
discussions: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get install -y cmake build-essential

- name: Configure
run: cmake -S . -B build

- name: Build
run: cmake --build build --target havo -j 10

- name: Zip osmon std folder
run: zip -r build/library.zip library

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
build/libhavo.so
include/libhavo.h
build/library.zip
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test & Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl

steps:
- uses: actions/checkout@v3

- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

# - name: Test
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
# run: ctest --build-config ${{ matrix.build_type }}
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
### C++ template
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### C template
# Prerequisites

# Object files
*.ko
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers

# Libraries

# Shared objects (inc. Windows DLLs)
*.so.*

# Executables
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

### CMake template
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
output
cmake-build-debug
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.26)
PROJECT(
havo
VERSION 0.0.3
LANGUAGES C
DESCRIPTION "Standard Library of Osmon"
)

INCLUDE(GNUInstallDirs)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug)
ENDIF()

SET(CMAKE_C_STANDARD 23)
SET(BUILD_SHARED_LIBS ON)

SET(SOURCE_FILES
source/library.c
)

ADD_LIBRARY(havo SHARED ${SOURCE_FILES})

INSTALL(TARGETS havo
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
Loading

0 comments on commit 9171c41

Please sign in to comment.