Skip to content

Commit

Permalink
Merge branch 'release/v1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-baggs committed Oct 16, 2021
2 parents a274b04 + 802c96b commit cbc2f57
Show file tree
Hide file tree
Showing 435 changed files with 42,735 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
UseTab: Never
IndentWidth: 4
BreakBeforeBraces: Allman
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 0
NamespaceIndentation: None
FixNamespaceComments: false
AllowAllConstructorInitializersOnNextLine: true
BreakConstructorInitializers: BeforeComma
AllowShortBlocksOnASingleLine: Never
AlignTrailingComments: true
ColumnLimit: 120
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
BinPackParameters: false
AlignAfterOpenBracket: AlwaysBreak
IndentCaseLabels: true
AllowAllParametersOfDeclarationOnNextLine: false
PenaltyBreakBeforeFirstCallParameter: 80
PenaltyReturnTypeOnItsOwnLine: 1000
ExperimentalAutoDetectBinPacking: false
PointerAlignment: Right
AlwaysBreakTemplateDeclarations: Yes
AllowShortCaseLabelsOnASingleLine: true
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build

on: [pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
build_type: [Debug, Release]

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 ${{github.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: ${{github.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

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

- name: Test
working-directory: ${{github.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
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: release

on:
create:

jobs:
build:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
os: macos-latest,
package_ext: .tar.gz
}
- {
os: windows-latest,
package_ext: .zip
}
build_type: [Release]

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 ${{github.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: ${{github.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

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

- name: Test
working-directory: ${{github.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: Package
working-directory: ${{github.workspace}}/build
shell: bash
run: cpack -B package

- uses: actions/checkout@v2
working-directory: ${{github.workspace}}/build
with:
name: upload
path: package/.*${{ matrix.config.package_ext }}

- uses: actions/download-artifact@v2
working-directory: ${{github.workspace}}/build
with:
name: release_build
path: package/.*${{ matrix.config.package_ext }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.DS_STORE
.ycm_extra_conf.*
CMakeCache.txt
CMakeFiles/
CMakeScripts/
*.cmake
build/
xcode_build/
*.swp
obj/
*.a
*.o
*.data
tags
tmp/
Makefile
.clangd/
compile_commands.json
.vscode/
118 changes: 118 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
cmake_minimum_required(VERSION 3.18)

project(
iris
VERSION "1.0.0"
DESCRIPTION "Cross-platform game engine"
LANGUAGES C CXX)

include(CMakePackageConfigHelpers)
include(FetchContent)
include(GNUInstallDirs)
include(GenerateExportHeader)

# set options for library
option(IRIS_BUILD_UNIT_TESTS "whether to build unit tests" ON)

set(CMAKE_CXX_STANDARD 20)
set(ASM_OPTIONS "-x assembler-with-cpp")

# if a platform wasn't supplied then default to current platform
if(NOT IRIS_PLATFORM)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(IRIS_PLATFORM "MACOS")
set(IRIS_ARCH "X86_64")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(IRIS_PLATFORM "WIN32")
set(IRIS_ARCH "X86_64")
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()
endif()

if(IRIS_PLATFORM MATCHES "MACOS" OR IRIS_PLATFORM MATCHES "IOS")
enable_language(OBJC)
enable_language(OBJCXX)
enable_language(ASM)
endif()

# set options for third party libraries
set(BUILD_UNIT_TESTS OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(BUILD_CPU_DEMOS OFF CACHE BOOL "" FORCE)
set(BUILD_BULLET2_DEMOS OFF CACHE BOOL "" FORCE)
set(BUILD_EXTRAS OFF CACHE BOOL "" FORCE)
set(BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_SAMPLES OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ZLIB ON CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_FBX_IMPORTER ON CACHE BOOL "" FORCE)
set(ASSIMP_NO_EXPORT ON CACHE BOOL "" FORCE)

# fetch third party libraries
# note that in most cases we manually populate and add, this alloes us to use
# EXCLUDE_FROM_ALL to prevent them from being included in the install step

FetchContent_Declare(
assimp
GIT_REPOSITORY https://github.com/assimp/assimp
GIT_TAG v5.0.1)
FetchContent_GetProperties(assimp)
if(NOT assimp_POPULATED)
FetchContent_Populate(assimp)
add_subdirectory(${assimp_SOURCE_DIR} ${assimp_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

FetchContent_Declare(
bullet
GIT_REPOSITORY https://github.com/bulletphysics/bullet3
GIT_TAG 3.17)
FetchContent_GetProperties(bullet)
if(NOT bullet_POPULATED)
FetchContent_Populate(bullet)
add_subdirectory(${bullet_SOURCE_DIR} ${bullet_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

# stb doesn't have a cmake file, so just make it available
FetchContent_Declare(
stb
GIT_REPOSITORY https://github.com/nothings/stb
GIT_TAG c0c982601f40183e74d84a61237e968dca08380e
CONFIGURE_COMMAND "" BUILD_COMMAND "")
FetchContent_MakeAvailable(stb)

FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

if(IRIS_PLATFORM MATCHES "WIN32")
FetchContent_Declare(
directx-headers
GIT_REPOSITORY https://github.com/microsoft/DirectX-Headers.git
GIT_TAG v1.4.9)
FetchContent_GetProperties(directx-headers)
if(NOT directx-headers_POPULATED)
FetchContent_Populate(directx-headers)
add_subdirectory(${directx-headers_SOURCE_DIR} ${directx-headers_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif()

add_subdirectory("src")
add_subdirectory("samples")

if(IRIS_BUILD_UNIT_TESTS)
enable_testing()
include(CTest)
add_subdirectory("tests")
endif()

include(cmake/cpack.cmake)
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit cbc2f57

Please sign in to comment.