Skip to content

Commit

Permalink
Merge pull request #36 from albin-johansson/dev
Browse files Browse the repository at this point in the history
Merge dev into main for v0.2.0
  • Loading branch information
albin-johansson authored Oct 25, 2021
2 parents b57add8 + 3bdcb0b commit a7d5d48
Show file tree
Hide file tree
Showing 1,216 changed files with 213,612 additions and 41,711 deletions.
33 changes: 0 additions & 33 deletions .appveyor.yml

This file was deleted.

55 changes: 45 additions & 10 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,67 @@ IndentWidth: 2
---
Language: Cpp
Standard: c++20

ColumnLimit: 90

DerivePointerAlignment: false
PointerAlignment: Left
AllowAllParametersOfDeclarationOnNextLine: false

AlwaysBreakAfterDefinitionReturnType: None
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
AllowShortLambdasOnASingleLine: All
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AlwaysBreakAfterReturnType: None

BinPackParameters: false
BinPackArguments: false

BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: true
AfterStruct: true
AfterClass: true
AfterStruct: true
AfterUnion: true
AfterEnum: true
AfterFunction: true
AfterExternBlock: true
AfterControlStatement: MultiLine
AfterCaseLabel: false
BeforeElse: true
BeforeCatch: true
SplitEmptyNamespace: false
SplitEmptyRecord: false
SplitEmptyFunction: false

AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
BreakBeforeBinaryOperators: None

EmptyLineBeforeAccessModifier: Always

NamespaceIndentation: None
FixNamespaceComments: true

BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakConstructorInitializers: BeforeComma
AllowAllConstructorInitializersOnNextLine: false

AllowShortLambdasOnASingleLine: None
AllowAllArgumentsOnNextLine: false
IndentRequires: true

SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
# Standard headers, located in <> with no extension.
- Regex: '<([A-Za-z0-9\_\-]+)>'
Priority: 10

# Tactile IO or base headers
- Regex: '<((tactile-io|tactile-base)\/)+([A-Za-z0-9\_\-]+)\.([A-Za-z0-9\_\-]+)>'
Priority: 13

# Headers in <> with extension and optional prefix.
- Regex: '<([A-Za-z0-9\_\-]+\/)*(\.\.)*([A-Za-z0-9\_\-]+)\.([A-Za-z0-9\_\-]+)>'
Priority: 15

BreakInheritanceList: BeforeColon
# Headers in "" with extension.
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 40
75 changes: 75 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "CI: Windows"

on: [ push, pull_request ]

env:
SDL_VERSION: 2.0.16
IMG_VERSION: 2.0.5
TTF_VERSION: 2.0.15
GLEW_VERSION: 2.2.0

jobs:
windows-latest-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- uses: ilammy/msvc-dev-cmd@master
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: lukka/get-cmake@latest

- name: Create binaries directory
shell: cmd
run: mkdir bin

- name: Download SDL2
uses: albin-johansson/download-sdl2@latest
with:
version: ${{env.SDL_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Download SDL2_image
uses: albin-johansson/download-sdl2-image@latest
with:
version: ${{env.IMG_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Download SDL2_ttf
uses: albin-johansson/download-sdl2-ttf@latest
with:
version: ${{env.TTF_VERSION}}
sources_destination: .
binaries_destination: bin

- name: Download GLEW
shell: powershell
run: |
Invoke-WebRequest -Uri "https://sourceforge.net/projects/glew/files/glew/${{env.GLEW_VERSION}}/glew-${{env.GLEW_VERSION}}-win32.zip" `
-OutFile glew.zip `
-UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox
7z x -y glew.zip
del glew.zip
Copy-Item -Path glew-${{env.GLEW_VERSION}}/bin/Release/x64/glew32.dll `
-Destination bin/glew32.dll
- name: Create build folder
shell: cmd
run: cmake -E make_directory ./build

- name: Build
working-directory: ./build
shell: cmd
env:
SDL2DIR: ${{github.workspace}}/SDL2-${{env.SDL_VERSION}}
SDL2IMAGEDIR: ${{github.workspace}}/SDL2_image-${{env.IMG_VERSION}}
SDL2TTFDIR: ${{github.workspace}}/SDL2_ttf-${{env.TTF_VERSION}}
GLEW_LIBRARIES: ${{github.workspace}}/glew-${{env.GLEW_VERSION}}/lib/Release/x64
run: |
cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja
ninja
- name: Run tests
working-directory: ./build/build/test
shell: cmd
run: TactileTests.exe
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,4 @@ compile_commands.json
doxygen-out
build
cmake-build-*

# Allow all necessary installer data and metainformation
!installer/packages/com.albinjohansson.tactile/**/*
!installer/*
installer/packages/com.albinjohansson.tactile/data/*
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

69 changes: 51 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,65 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.18)

project(tactile CXX)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_PREFIX_PATH "$ENV{BOOST_ROOT}; $ENV{Qt5_PATH}")
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/build")

include(Utilities)
if (MSVC)
add_compile_options(/std:c++latest) # This is a workaround for issues with <format>
else ()
set(CMAKE_CXX_STANDARD 20)
endif ()

set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBRARY_DIR ${ROOT_DIR}/lib)
set(RESOURCE_DIR ${ROOT_DIR}/resources)

find_env_var(Qt5_PATH)
find_env_var(BOOST_ROOT)
# Target names
set(TACTILE_PROTO prototactile)
set(TACTILE_LIB libtactile)
set(TACTILE_EXE Tactile)
set(TACTILE_TEST TactileTests)

foreach (path ${CMAKE_PREFIX_PATH})
message("CMake prefix path: " ${path})
endforeach (path)
set(TACTILE_IO_IMPORT_LIBRARY "${CMAKE_BINARY_DIR}/modules/tactile-io/TactileIO${CMAKE_IMPORT_LIBRARY_SUFFIX}")

set(LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
list(APPEND CMAKE_PREFIX_PATH
"$ENV{GLEW_LIBRARIES}"
"${LIBRARY_DIR}/glew")

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)

set(TACTILE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(IMGUI_SOURCES
${LIBRARY_DIR}/imgui/imconfig.h
${LIBRARY_DIR}/imgui/imgui.cpp
${LIBRARY_DIR}/imgui/imgui.h
${LIBRARY_DIR}/imgui/imgui_demo.cpp
${LIBRARY_DIR}/imgui/imgui_draw.cpp
${LIBRARY_DIR}/imgui/imgui_impl_opengl3.cpp
${LIBRARY_DIR}/imgui/imgui_impl_opengl3.h
${LIBRARY_DIR}/imgui/imgui_impl_sdl.cpp
${LIBRARY_DIR}/imgui/imgui_impl_sdl.h
${LIBRARY_DIR}/imgui/imgui_internal.h
${LIBRARY_DIR}/imgui/imgui_tables.cpp
${LIBRARY_DIR}/imgui/imgui_widgets.cpp
${LIBRARY_DIR}/imgui/imstb_rectpack.h
${LIBRARY_DIR}/imgui/imstb_textedit.h
${LIBRARY_DIR}/imgui/imstb_truetype.h)

find_package(Qt5 COMPONENTS Core Widgets Gui Xml REQUIRED)
find_package(Boost REQUIRED)
set(PUGIXML_SOURCES
${LIBRARY_DIR}/pugixml/pugiconfig.hpp
${LIBRARY_DIR}/pugixml/pugixml.cpp
${LIBRARY_DIR}/pugixml/pugixml.hpp)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
include(Utilities)
include(TactileDependencies)

add_subdirectory(src)
add_subdirectory(modules/tactile-proto)
add_subdirectory(modules/tactile-io)
add_subdirectory(modules/tactile)
add_subdirectory(test)
Loading

0 comments on commit a7d5d48

Please sign in to comment.