Skip to content

Commit

Permalink
Merge pull request #89 from UwUClub/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Valegox authored Nov 2, 2023
2 parents 28770f6 + cf678d2 commit f154252
Show file tree
Hide file tree
Showing 194 changed files with 3,419 additions and 30,676 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- main
- dev
- release

env:
CLANG_TIDY_VERSION: "15.0.2"
Expand Down Expand Up @@ -85,6 +86,11 @@ jobs:
gcovr: true
opencppcoverage: true

- name: Install xrand
if: runner.os != 'Windows'
run: |
sudo apt-get install -y freeglut3-dev libfreetype6-dev libx11-dev libxrandr-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev libvorbisenc2 libvorbisfile3 libopenal-dev libpthread-stubs0-dev xorg-dev
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -D${{ env.PROJECT_NAME }}_ENABLE_IPO=${{matrix.enable_ipo }} -DCMAKE_BUILD_TYPE:STRING=Release -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=False -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=True -DGIT_SHA:STRING=${{ github.sha }} -DR_Type_ENABLE_SANITIZER_ADDRESS=OFF -DR_Type_ENABLE_SANITIZER_UNDEFINED=OFF
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ jobs:

# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
# has meaningful results

- name: Install xrand
if: runner.os != 'Windows'
run: |
sudo apt-get install -y freeglut3-dev libfreetype6-dev libx11-dev libxrandr-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev libvorbisenc2 libvorbisfile3 libopenal-dev libpthread-stubs0-dev xorg-dev
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "extern/EwECS"]
path = extern/EwECS
url = https://github.com/UwUClub/EwECS.git
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
84 changes: 25 additions & 59 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.21)
find_package(SDL2 QUIET)

# This template attempts to be "fetch_content"-able
# so that it works well with tools like CPM or other
Expand All @@ -10,11 +9,6 @@ if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()

# strongly encouraged to enable this globally to avoid conflicts between
# -Wpedantic being enabled and -std=c++20 and -std=gnu++20 for example
# when compiling with PCH enabled
set(CMAKE_CXX_EXTENSIONS OFF)

# Set the project name and language
project(
R_Type
Expand All @@ -23,90 +17,61 @@ project(
HOMEPAGE_URL "https://github.com/UwUClub/R-Type"
LANGUAGES CXX C)

include(cmake/PreventInSourceBuilds.cmake)
include(ProjectOptions.cmake)
if (NOT TARGET SDL2::SDL2)
set(SDL2_DOWNLOADED TRUE)
else()
set(SDL2_DOWNLOADED FALSE)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
R_Type_setup_options()

R_Type_global_options()
include(Dependencies.cmake)
R_Type_setup_dependencies()
add_library(R_Type_warnings INTERFACE)

R_Type_local_options()
include(cmake/CompilerWarnings.cmake)
R_Type_set_project_warnings(
R_Type_warnings
FALSE
""
""
""
"")

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
include(Dependencies.cmake)
R_Type_setup_dependencies()

set(GIT_SHA
"Unknown"
CACHE STRING "SHA this build was generated from")
string(
SUBSTRING "${GIT_SHA}"
0
8
GIT_SHORT_SHA)
include(cmake/StandardProjectSettings.cmake)

target_compile_features(R_Type_options INTERFACE cxx_std_${CMAKE_CXX_STANDARD})
# exec submodules init and update
execute_process(COMMAND git submodule update --init --recursive --remote)
add_subdirectory(extern)
# expose the includes folder of the submodules

add_library(R_Type::R_Type_options ALIAS R_Type_options)
add_library(R_Type::R_Type_warnings ALIAS R_Type_warnings)

#add_library(R_Type::R_Type_options INTERFACE IMPORTED)
#add_library(R_Type::R_Type_warnings INTERFACE IMPORTED)

# Adding the src:
add_subdirectory(src)

# Don't even look at tests if we're not top level
if(NOT PROJECT_IS_TOP_LEVEL)
return()
endif()

# Adding the tests:
#include(CTest)
# include(CTest)

#if(BUILD_TESTING)
# add_subdirectory(test)
#endif()
# if(BUILD_TESTING)
# add_subdirectory(test)
# endif()

# If MSVC is being used, and ASAN is enabled, we need to set the debugger environment
# so that it behaves well with MSVC's debugger, and we can run the target from visual studio
if(MSVC)
include(cmake/Utilities.cmake)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
get_all_installable_targets(all_targets)
message("all_targets=${all_targets}")
set_target_properties(${all_targets} PROPERTIES VS_DEBUGGER_ENVIRONMENT "PATH=$(VC_ExecutablePath_x64);%PATH%")
endif()

file(COPY ${CMAKE_SOURCE_DIR}/assets DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${CMAKE_SOURCE_DIR}/config DESTINATION ${CMAKE_BINARY_DIR}/bin)

# set the startup project for the "play" button in MSVC
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT server)

if(CMAKE_SKIP_INSTALL_RULES)
return()
endif()

include(cmake/PackageProject.cmake)
find_package(Boost)

# Add other targets that you want installed here, by default we just package the one executable
# we know we want to ship
R_Type_package_project(
TARGETS
server
client
R_Type_options
R_Type_warnings
)
# Experience shows that explicit package naming can help make it easier to sort
# out potential ABI related issues before they start, while helping you
# track a build to a specific GIT SHA
install(TARGETS server client
install(TARGETS server client flappybird
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand All @@ -130,5 +95,6 @@ else()
endif()

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets" DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/config" DESTINATION ${CMAKE_INSTALL_BINDIR})

include(CPack)
include(CPack)
Loading

0 comments on commit f154252

Please sign in to comment.