-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add support to turn off renderer using RAWRBOX_BUILD_RAWRBOX_RENDER - Jolt improvements - Fixed missing RAWRBOX_TRACE_EXCEPTIONS checks
- Loading branch information
Showing
33 changed files
with
179 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ option(RAWRBOX_USE_WAYLAND "Use Wayland for linux" OFF) | |
option(RAWRBOX_BUILD_TESTING "Build tests" OFF) | ||
option(RAWRBOX_BUILD_SAMPLES "Build samples" OFF) | ||
|
||
option(RAWRBOX_BUILD_RAWRBOX_RENDER "Build rawrbox renderer, disable for renderless programs" ON) | ||
option(RAWRBOX_BUILD_RAWRBOX_UI "Build rawrbox UI" OFF) | ||
option(RAWRBOX_BUILD_RAWRBOX_RESOURCES "Build rawrbox resources utils" OFF) | ||
option(RAWRBOX_BUILD_RAWRBOX_3D_PHYSICS "Build 3D physics support" OFF) | ||
|
@@ -63,26 +64,27 @@ option(RAWRBOX_INTERPROCEDURAL_OPTIMIZATION "Enables IPO" ON) | |
# --------------- | ||
# ----- | ||
|
||
if(RAWRBOX_INTERPROCEDURAL_OPTIMIZATION) | ||
message(WARNING "Enabled INTERPROCEDURAL_OPTIMIZATION") | ||
if(RAWRBOX_INTERPROCEDURAL_OPTIMIZATION AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64") AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM")) | ||
message(STATUS "Enabled INTERPROCEDURAL_OPTIMIZATION for release and distribution") | ||
|
||
include(CheckIPOSupported) | ||
check_ipo_supported(RESULT ipoSupported OUTPUT error) | ||
|
||
if(ipoSupported) | ||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) | ||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DISTRIBUTION TRUE) | ||
else() | ||
message(FATAL_ERROR "IPO / LTO is not supported, please disable RAWRBOX_INTERPROCEDURAL_OPTIMIZATION") | ||
endif() | ||
endif() | ||
|
||
# Uncomment for package.lock generation | ||
if(RAWRBOX_DEV_MODE) | ||
message(WARNING "RAWRBOX Dev mode enabled!") | ||
|
||
set(RAWRBOX_BUILD_TESTING ON) | ||
set(RAWRBOX_BUILD_SAMPLES ON) | ||
|
||
set(RAWRBOX_BUILD_RAWRBOX_RENDER ON) | ||
set(RAWRBOX_BUILD_RAWRBOX_UI ON) | ||
set(RAWRBOX_BUILD_RAWRBOX_RESOURCES ON) | ||
set(RAWRBOX_BUILD_RAWRBOX_3D_PHYSICS ON) | ||
|
@@ -135,14 +137,16 @@ if(NOT WIN32) | |
list(APPEND RAWRBOX_EXTRA_LIBS wayland-egl) | ||
set(GLFW_BUILD_WAYLAND ON CACHE INTERNAL "") | ||
endif() | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fexceptions") # Enable exceptions and RTTI | ||
else() | ||
# Ignore warnings about missing pdb | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4099") | ||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4099") | ||
|
||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive- /EHsc /GR") # Enable strict mode, exceptions and RTTI | ||
endif() | ||
|
||
set(CMAKE_SKIP_RPATH TRUE) | ||
|
@@ -162,14 +166,26 @@ endif() | |
# --------------------- | ||
|
||
## CHECKS --- | ||
if(RAWRBOX_BUILD_SAMPLES AND NOT RAWRBOX_BUILD_RAWRBOX_RESOURCES) | ||
message(WARNING "Samples require RAWRBOX.RESOURCES to be enabled, enabling...") | ||
set(RAWRBOX_BUILD_RAWRBOX_RESOURCES ON) | ||
endif() | ||
if(NOT RAWRBOX_BUILD_RAWRBOX_RENDER) | ||
message(WARNING "----------------------------------------\nRAWRBOX_BUILD_RAWRBOX_RENDER is disabled!\nDisabling UI / ASSIMP / IMGUI / WEBM and samples..\n----------------------------------------") | ||
set(RAWRBOX_BUILD_RAWRBOX_UI OFF) | ||
set(RAWRBOX_BUILD_RAWRBOX_ASSIMP OFF) | ||
set(RAWRBOX_BUILD_RAWRBOX_IMGUI OFF) | ||
set(RAWRBOX_BUILD_RAWRBOX_WEBM OFF) | ||
|
||
set(RAWRBOX_BUILD_SAMPLES OFF) | ||
else() | ||
# Samples & UI --- | ||
if(RAWRBOX_BUILD_SAMPLES AND NOT RAWRBOX_BUILD_RAWRBOX_RESOURCES) | ||
message(WARNING "Samples require RAWRBOX.RESOURCES to be enabled, enabling...") | ||
set(RAWRBOX_BUILD_RAWRBOX_RESOURCES ON) | ||
endif() | ||
|
||
if(RAWRBOX_BUILD_RAWRBOX_UI AND NOT RAWRBOX_BUILD_RAWRBOX_RESOURCES) | ||
message(WARNING "RAWRBOX.UI requires RAWRBOX.RESOURCES to be enabled, enabling...") | ||
set(RAWRBOX_BUILD_RAWRBOX_RESOURCES ON) | ||
if(RAWRBOX_BUILD_RAWRBOX_UI AND NOT RAWRBOX_BUILD_RAWRBOX_RESOURCES) | ||
message(WARNING "RAWRBOX.UI requires RAWRBOX.RESOURCES to be enabled, enabling...") | ||
set(RAWRBOX_BUILD_RAWRBOX_RESOURCES ON) | ||
endif() | ||
# ----------- | ||
endif() | ||
|
||
if(NOT RAWRBOX_BUILD_MSVC_MULTITHREADED_RUNTIME AND RAWRBOX_BUILD_RAWRBOX_3D_PHYSICS) | ||
|
@@ -189,8 +205,10 @@ if(magic_enum_ADDED) | |
set_lib_runtime_mt(magic_enum) | ||
endif() | ||
|
||
if(NOT WIN32 AND RAWRBOX_USE_WAYLAND) | ||
CPMAddPackage("https://gitlab.freedesktop.org/wayland/[email protected]") | ||
if(RAWRBOX_BUILD_RAWRBOX_RENDER) | ||
if(NOT WIN32 AND RAWRBOX_USE_WAYLAND) | ||
CPMAddPackage("https://gitlab.freedesktop.org/wayland/[email protected]") | ||
endif() | ||
endif() | ||
|
||
CPMAddPackage("gh:stephenberry/[email protected]") | ||
|
@@ -231,6 +249,11 @@ add_subdirectory("rawrbox.math") | |
add_subdirectory("rawrbox.utils") | ||
add_subdirectory("rawrbox.engine") | ||
|
||
if(RAWRBOX_BUILD_RAWRBOX_RENDER) | ||
message(STATUS "Enabled RAWRBOX.RENDER support") | ||
add_subdirectory("rawrbox.render") | ||
endif() | ||
|
||
if(RAWRBOX_BUILD_RAWRBOX_SCRIPTING) | ||
message(STATUS "Enabled RAWRBOX.SCRIPTING support") | ||
add_subdirectory("rawrbox.scripting") | ||
|
@@ -246,8 +269,6 @@ if(RAWRBOX_BUILD_RAWRBOX_NETWORK) | |
add_subdirectory("rawrbox.network") | ||
endif() | ||
|
||
add_subdirectory("rawrbox.render") | ||
|
||
if(RAWRBOX_BUILD_RAWRBOX_WEBM) | ||
message(STATUS "Enabled RAWRBOX.WEBM support") | ||
add_subdirectory("rawrbox.webm") | ||
|
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
Oops, something went wrong.