Skip to content

Commit ad6dd7f

Browse files
committed
Initial commit.
0 parents  commit ad6dd7f

File tree

980 files changed

+117629
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

980 files changed

+117629
-0
lines changed

.github/workflows/cmake.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CMake
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
env:
6+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7+
BUILD_TYPE: Release
8+
9+
jobs:
10+
build_windows:
11+
# The CMake configure and build commands are platform agnostic and should work equally
12+
# well on Windows or Mac. You can convert this to a matrix build if you need
13+
# cross-platform coverage.
14+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
15+
runs-on: windows-latest
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
steps:
21+
- uses: actions/checkout@v1
22+
with:
23+
path: 'source'
24+
submodules: 'recursive'
25+
persist-credentials: false
26+
27+
- name: configure
28+
run: mkdir build && cd build && cmake -DWORKFLOW=TRUE ..
29+
- name: build
30+
run: cd build && cmake --build . --target RecordingPlugin
31+
- name: build_test
32+
run: cd build && cmake --build . --target tests && cd Debug && ls && ./tests.exe
33+
#- name: android_build
34+
# shell: cmd
35+
# run: .\buildAndroid.bat

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/cmake-build-debug/*
2+
/cmake-build-release/*
3+
.idea/.name

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[submodule "External/glm"]
2+
path = External/glm
3+
url = https://github.com/g-truc/glm.git
4+
[submodule "External/AudioFile"]
5+
path = External/AudioFile
6+
url = https://github.com/adamstark/AudioFile.git
7+
[submodule "External/Catch2"]
8+
path = External/Catch2
9+
url = https://github.com/catchorg/Catch2.git
10+
[submodule "External/zlib"]
11+
path = External/zlib
12+
url = https://github.com/madler/zlib.git
13+
[submodule "External/thread-pool"]
14+
path = External/thread-pool
15+
url = https://github.com/bshoshany/thread-pool

AnalysisTest/Test.cpp

Lines changed: 231 additions & 0 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
project(RecordingPlugin VERSION "0.8.4")
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
6+
set(UnityDir Unity)
7+
set(SrcDir Src)
8+
set(ExternalDir External)
9+
set(TestDir Test)
10+
set(AnalysisTestDir AnalysisTest)
11+
set(UtilsDir Utils)
12+
13+
configure_file(Config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/${SrcDir}/Config.h @ONLY)
14+
15+
if(ANDROID_BUILD)
16+
set( UNITY_PLUGINS_DIR "C:/Users/Anton-Lammert/Desktop/ImmersiveStudyAnalyzer/Assets/Plugins/Android/ARM64" )
17+
else()
18+
set( UNITY_PLUGINS_DIR "C:/Users/Anton-Lammert/Desktop/ImmersiveStudyAnalyzer/Assets/Plugins/Windows" )
19+
endif()
20+
21+
if(NOT WORKFLOW)
22+
if(EXISTS ${UNITY_PLUGINS_DIR})
23+
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${UNITY_PLUGINS_DIR} )
24+
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${UNITY_PLUGINS_DIR} )
25+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${UNITY_PLUGINS_DIR} )
26+
endif()
27+
endif()
28+
29+
# find all source files
30+
file(GLOB_RECURSE SRC_FILES
31+
${SrcDir}/*.h.in
32+
${SrcDir}/*.cpp
33+
${SrcDir}/*.h
34+
${UnityDir}/*.cpp
35+
${UnityDir}/*.h
36+
External/AudioFile/*.h
37+
External/ThreadPool/*.hpp
38+
)
39+
40+
file(GLOB_RECURSE TEST_FILES
41+
${SrcDir}/*.h.in
42+
${SrcDir}/*.cpp
43+
${SrcDir}/*.h
44+
${UnityDir}/*.cpp
45+
${UnityDir}/*.h
46+
${TestDir}/Test.cpp
47+
${UtilsDir}/*.cpp
48+
${UtilsDir}/*.h
49+
External/AudioFile/*.h
50+
External/ThreadPool/*.hpp
51+
)
52+
53+
file(GLOB_RECURSE ANALYSIS_TEST_FILES
54+
${SrcDir}/*.h.in
55+
${SrcDir}/*.cpp
56+
${SrcDir}/*.h
57+
${UnityDir}/*.cpp
58+
${UnityDir}/*.h
59+
${AnalysisTestDir}/*.cpp
60+
${AnalysisTestDir}/*.h
61+
External/AudioFile/*.h
62+
External/ThreadPool/*.hpp
63+
)
64+
65+
include_directories(${SrcDir} ${UnityDir})
66+
67+
add_subdirectory(External/glm EXCLUDE_FROM_ALL)
68+
add_subdirectory(External/zlib)
69+
70+
include_directories(${CMAKE_SOURCE_DIR}/External/zlib ${CMAKE_BINARY_DIR}/External/zlib)
71+
72+
if(NOT ANDROID_BUILD)
73+
add_subdirectory(External/Catch2)
74+
75+
set(TEST_LIBRARIES PRIVATE glm Catch2::Catch2 zlibstatic)
76+
77+
add_executable(tests ${TEST_FILES})
78+
target_link_libraries(tests ${TEST_LIBRARIES})
79+
80+
add_executable(analysis_tests ${ANALYSIS_TEST_FILES})
81+
target_link_libraries(analysis_tests ${TEST_LIBRARIES})
82+
endif()
83+
84+
set(COMMON_LIBRARIES PRIVATE glm zlibstatic)
85+
86+
# create a shared library (.dll/.so)
87+
add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
88+
target_link_libraries(${PROJECT_NAME} ${COMMON_LIBRARIES})

Config.h.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef CONFIG_H_IN
2+
#define CONFIG_H_IN
3+
4+
#include <zlib.h>
5+
#include <stdint.h>
6+
7+
#define PROJECT_NAME "@PROJECT_NAME@"
8+
#define PROJECT_VER "@PROJECT_VERSION@"
9+
#define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
10+
#define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@"
11+
#define PROJECT_VER_PATCH "@PROJECT_VERSION_PATCH@"
12+
#define COMPRESSION 0
13+
#define COMPRESSION_LEVEL 5 // 1 (low) to 9 (high but slow)
14+
#define MULTI_THREADED 1
15+
const size_t HEADER_SIZE = sizeof(uint32_t); // size of compressed data block header
16+
17+
#endif // INCLUDE_GUARD
164 KB
Loading
3.02 KB
Loading

0 commit comments

Comments
 (0)