Skip to content

Commit

Permalink
Big bang
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiscodeDev committed Aug 3, 2023
0 parents commit cec1465
Show file tree
Hide file tree
Showing 131 changed files with 11,650 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Linux Build

on: [push]

#env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DPRODUCTION_BUILD=ON

- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build .

- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest

- name: Create Package
if: contains(github.ref, 'refs/heads/release')
working-directory: ${{runner.workspace}}/build
shell: bash
run: cpack

- name: Archive Artifacts
if: contains(github.ref, 'refs/heads/release')
uses: actions/upload-artifact@v2
with:
name: RoostHsm-production-library
path: |
${{ runner.workspace }}/build/RoostHsm*.tar.gz

40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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

*.idea
build
CMakeLists.txt.user
*.swp
*.autosave
.vscode
cmake-build-debug*
91 changes: 91 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.5)

project(RoostHsm LANGUAGES CXX)

# Options

option(BUILD_TESTS "Build Tests" ON)
option(BUILD_BENCH "Build Benchmark Suite" ON)
option(BUILD_EXAMPLES "Build the examples folder" ON)

option(DEBUG_BUILD "Build in Debug" OFF)

# This setting is to create the production build to be pulled in by other projects
# A production build:
# - Turns off debug builds
# - Doesn't build benchmarks or examples
# - Builds tests, but does not package them
option(PRODUCTION_BUILD "Build with production settings" OFF)

if(PRODUCTION_BUILD)

set(BUILD_BENCH OFF)
set(BUILD_EXAMPLES OFF)

set(DEBUG_BUILD OFF)

endif()

MESSAGE("PRODUCTION BUILD? " ${PRODUCTION_BUILD})
MESSAGE("BUILD TESTS? " ${BUILD_TESTS})
MESSAGE("BUILD BENCH? " ${BUILD_BENCH})
MESSAGE("BUILD EXAMPLES? " ${BUILD_EXAMPLES})
MESSAGE("DEBUG BUILD? " ${DEBUG_BUILD})

# Project Info

set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

# C++ Version
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# ---------------------------------------------------------

if (DEBUG_BUILD)
set(CMAKE_BUILD_TYPE Debug)
set(PACKAGE_TYPE_STR debug)

elseif(PRODUCTION_BUILD)
set(CMAKE_BUILD_TYPE Release)
set(PACKAGE_TYPE_STR prod)

else()
set(CMAKE_BUILD_TYPE Release)
set(PACKAGE_TYPE_STR dev)
endif()

include(GNUInstallDirs)
include(ExternalProject)
include(CTest)

if (BUILD_TESTS)
enable_testing()
include(cmake/googletest.cmake)
endif()

if (BUILD_BENCH)
include(cmake/hayai.cmake)
endif()

# Setup Apps
add_subdirectory(lib)

if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()


# Package Info
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})

set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}-${PACKAGE_TYPE_STR}")

# Include Cpack after setting variables for them to take effect
include(CPack)
Loading

0 comments on commit cec1465

Please sign in to comment.