-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
257 changed files
with
3,240 additions
and
2,923 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,23 @@ | ||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) | ||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR) | ||
|
||
# ---- Project ---- | ||
project(Intern) | ||
cmake_policy(SET CMP0054 NEW) | ||
# ----------------- | ||
|
||
# Enable all warnings | ||
if(MSVC) | ||
message(STATUS "MSVC") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") | ||
else() | ||
message(STATUS "GCC") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") # -Wconversion -Wsign-conversion") | ||
endif() | ||
|
||
if(WERROR STREQUAL "YES") | ||
if(MSVC) | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Werror") # -O3 finds more errors! | ||
endif() | ||
|
||
message(STATUS "Werror mode") | ||
endif() | ||
|
||
if(VULKAN STREQUAL "NO") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D NO_VULKAN") | ||
message(STATUS "Vulkan disabled") | ||
endif() | ||
|
||
if(H5 STREQUAL "NO") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D NO_H5") | ||
message(STATUS "H5 disabled") | ||
endif() | ||
|
||
# Release repo | ||
# ---- Build options ---- | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/release) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib/release) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib/release) | ||
|
||
# Debug repo | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/debug) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib/debug) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib/debug) | ||
# ----------------------- | ||
|
||
|
||
add_subdirectory(RayCore) | ||
add_subdirectory(TerminalApp) | ||
# ---- Subdirectories ---- | ||
add_subdirectory(RAY-Core) | ||
add_subdirectory(RAY-CLI) | ||
add_subdirectory(RAY-X) | ||
# ------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR) | ||
|
||
|
||
# ---- Project ---- | ||
project(RAY-CLI VERSION 0.5.0.0) | ||
file(GLOB_RECURSE SOURCE ${PROJECT_SOURCE_DIR}/*.cpp) | ||
add_executable(${PROJECT_NAME} ${SOURCE}) | ||
# ------------------ | ||
|
||
|
||
# ---- Git Info ---- | ||
set(_build_version "unknown") | ||
find_package(Git) | ||
if(GIT_FOUND) | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE _build_version | ||
ERROR_QUIET | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
message(STATUS "GIT hash: ${_build_version}") | ||
else() | ||
message(STATUS "GIT not found") | ||
endif() | ||
string(TIMESTAMP _time_stamp) | ||
# Config file for the project (e.g. git hash can be referenced in the code) | ||
configure_file(TerminalAppConfig.h.in TerminalAppConfig.h) | ||
# ------------------ | ||
|
||
|
||
# ---- Dependencies ---- | ||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
CLI11::CLI11 | ||
RAY-Core | ||
${PYTHON_LIBRARIES} | ||
) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_BINARY_DIR}) | ||
# ---------------------- |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR) | ||
|
||
# ---- Add tests ---- | ||
add_subdirectory(tests) | ||
# ------------------- | ||
|
||
|
||
# ---- Project ---- | ||
project(RAY-Core) | ||
file(GLOB_RECURSE SOURCE ${PROJECT_SOURCE_DIR}/src/*.cpp) | ||
add_library(${PROJECT_NAME} SHARED ${SOURCE}) | ||
# ----------------- | ||
|
||
|
||
# ---- Warnings ---- | ||
if(MSVC) | ||
message(STATUS "MSVC") | ||
target_compile_options(${PROJECT_NAME} PRIVATE /W2 /wd4251) # /WX) | ||
else() | ||
message(STATUS "GCC") | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic) #-Werror) | ||
|
||
# Enable werror if requested (mostly used for CI) | ||
if(WERROR STREQUAL "YES") | ||
target_compile_options(${PROJECT_NAME} PRIVATE -O3 -Werror) | ||
message(STATUS "Werror mode") | ||
endif() | ||
endif() | ||
# ------------------ | ||
|
||
|
||
# ---- Disable Vulkan/H5 ---- | ||
if(VULKAN STREQUAL "NO") | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC NO_VULKAN) | ||
message(STATUS "Vulkan disabled") | ||
else() | ||
find_package(Vulkan 1.3.216 REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} | ||
PUBLIC Vulkan::Vulkan | ||
) | ||
endif() | ||
if(H5 STREQUAL "NO") | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC NO_H5) | ||
message(STATUS "H5 disabled") | ||
else() | ||
if(UNIX) | ||
target_include_directories(${PROJECT_NAME} PUBLIC /usr/include/hdf5/serial) | ||
target_link_directories(${PROJECT_NAME} PUBLIC /usr/lib/x86_64-linux-gnu/hdf5/serial) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC hdf5) | ||
else() | ||
find_package(HDF5 REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} | ||
PUBLIC HDF5::HDF5 | ||
) | ||
endif() | ||
endif() | ||
# ------------------------- | ||
|
||
|
||
# ---- PCH ---- | ||
target_precompile_headers(${PROJECT_NAME} PUBLIC raycorePCH.h) | ||
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) | ||
# ------------- | ||
|
||
|
||
# ---- Defines ---- | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
set(COMPILE_PLATFORM RAYX_PLATFORM_GCC) | ||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
set(COMPILE_PLATFORM RAYX_PLATFORM_MSVC) | ||
else() | ||
set(COMPILE_PLATFORM UNKNOWN) | ||
endif() | ||
|
||
target_compile_definitions(${PROJECT_NAME} | ||
PRIVATE RAYX_BUILD_DLL | ||
PUBLIC ${COMPILE_PLATFORM} | ||
PROJECT_DIR="${CMAKE_SOURCE_DIR}" | ||
$<$<CONFIG:Debug>:RAYX_DEBUG_MODE> | ||
$<$<CONFIG:RelWithDebInfo>:RAYX_DEBUG_MODE> | ||
) | ||
# ----------------- | ||
|
||
|
||
# ---- Dependencies ---- | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/src) | ||
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${PROJECT_SOURCE_DIR}/src) | ||
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC | ||
${PROJECT_SOURCE_DIR}/../../Extern/glm/glm/ | ||
${PROJECT_SOURCE_DIR}/../../Extern/rapidxml-1.13/ | ||
${PROJECT_SOURCE_DIR}/../../Extern/HighFive/include/ | ||
${PROJECT_SOURCE_DIR}/../../Extern/VMA/include/ | ||
) | ||
# ---------------------- | ||
|
||
|
||
# ---- Compile Shaders ---- | ||
if(NOT VULKAN STREQUAL "NO") | ||
# The following code is used to always compile the shader. | ||
# This is most likely not an optimal solution, but it will work | ||
# until we find a better one. | ||
add_dependencies(${PROJECT_NAME} COMPILE_SHADER) | ||
set(COMPILED_SHADER ${CMAKE_BINARY_DIR}/bin/comp.spv) | ||
set(COMPILED_SHADER_FAKE ${CMAKE_BINARY_DIR}/bin/___comp.spv) # this exists so file cannot be found -> always execute command | ||
|
||
add_custom_command( | ||
OUTPUT | ||
${COMPILED_SHADER} | ||
${COMPILED_SHADER_FAKE} | ||
COMMAND "glslc" | ||
ARGS ${PROJECT_SOURCE_DIR}/src/Tracer/shader/main-glsl.comp -o ${COMPILED_SHADER} -fshader-stage=compute | ||
) | ||
|
||
add_custom_target(COMPILE_SHADER ALL DEPENDS ${COMPILED_SHADER}) | ||
endif() | ||
# ------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# RAY-Core documentation | ||
|
||
RAY-Core is the core library of the RAY-X project. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.