Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 130 additions & 140 deletions build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,6 @@ platforms { "x64", "ARM64" }

defaultplatform "x64"

filter { "toolset:gcc or toolset:clang" }
buildoptions {
"-Werror",
"-Wredundant-decls",
"-Wcast-align",
"-Wno-sign-conversion",
"-Wdouble-promotion",
"-Wno-unused-parameter",
"-Wno-unused-function",
"-Wuninitialized",
"-pedantic",
"-fopenmp"
}

linkoptions {
"-fopenmp"
}

filter {}

filter { "system:windows" }
defines { "_CRT_SECURE_NO_WARNINGS" }

filter { "toolset:msc" }
buildoptions {
"/W4",
"/WX",
"/permissive-",
"/openmp",
"/MP",
}

linkoptions {
"/openmp",
"/MP",
}

filter {}

filter "configurations:Debug_*"
defines { "DEBUG" }
symbols "On"
Expand Down Expand Up @@ -98,6 +59,35 @@ project(workspaceName)
location "./"
targetdir "../bin/%{cfg.buildcfg}"

filter { "system:windows" }
defines { "_CRT_SECURE_NO_WARNINGS" }
buildoptions {
-- "/W4",
-- "/WX",
"/permissive-",
"/openmp:llvm",
"/MP",
}

filter { "system:linux" }
buildoptions {
"-Werror",
"-Wredundant-decls",
"-Wcast-align",
"-Wno-sign-conversion",
"-Wdouble-promotion",
"-Wno-unused-parameter",
"-Wno-unused-function",
"-Wuninitialized",
"-pedantic",
"-fopenmp"
}
linkoptions {
"-fopenmp"
}

filter {}

files {
path.getdirectory(os.getcwd()) .. "/external/stb/**.cpp",
path.getdirectory(os.getcwd()) .. "/external/stb/**.h",
Expand All @@ -106,110 +96,110 @@ project(workspaceName)
path.getdirectory(os.getcwd()) .. "/include/**.h",
}

filter { "configurations:*_GUI" }
files {
path.getdirectory(os.getcwd()) .. "/external/imgui/**.cpp",
path.getdirectory(os.getcwd()) .. "/external/imgui/**.h",
}

filter {}
filter { "configurations:*_GUI" }
files {
path.getdirectory(os.getcwd()) .. "/external/imgui/**.cpp",
path.getdirectory(os.getcwd()) .. "/external/imgui/**.h",
}

filter { "files:**/external/**", "toolset:msc" }
disablewarnings { "4100", "4244", "4267", "4389", "4505" }
filter {}

filter { "files:**/external/**", "toolset:gcc or toolset:clang" }
buildoptions { "-w", "-Wno-error" }
filter { "files:**/external/**", "system:windows" }
disablewarnings { "4100", "4244", "4267", "4389", "4505" }

filter {}
filter { "files:**/external/**", "system:linux" }
buildoptions { "-w", "-Wno-error" }

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/external",
path.getdirectory(os.getcwd()) .. "/lib",
path.getdirectory(os.getcwd()) .. "/lib/foundation",
path.getdirectory(os.getcwd()) .. "/lib/math",
path.getdirectory(os.getcwd()) .. "/lib/geometry",
path.getdirectory(os.getcwd()) .. "/lib/materials",
path.getdirectory(os.getcwd()) .. "/lib/raytracing",
path.getdirectory(os.getcwd()) .. "/lib/acceleration",
path.getdirectory(os.getcwd()) .. "/include",
}
filter {}

filter { "configurations:*_GUI" }
externalincludedirs {
path.getdirectory(os.getcwd()) .. "/external/imgui/",
path.getdirectory(os.getcwd()) .. "/external/SDL3/include",
}

filter {}

filter { "system:windows", "platforms:x64", "configurations:*_GUI" }
libdirs { path.getdirectory(os.getcwd()) .. "/external/SDL3/lib/windows/x64" }
links { "SDL3" }
postbuildcommands {
'{COPYFILE} "%{wks.location}/external/SDL3/lib/windows/x64/SDL3.dll" "%{cfg.targetdir}"'
}

filter { "system:windows", "platforms:ARM64", "configurations:*_GUI" }
libdirs { path.getdirectory(os.getcwd()) .. "/external/SDL3/lib/windows/arm64" }
links { "SDL3" }
postbuildcommands {
'{COPYFILE} "%{wks.location}/external/SDL3/lib/windows/arm64/SDL3.dll" "%{cfg.targetdir}"'
}

filter { "system:linux", "configurations:*_GUI" }
links { "SDL3" }

filter {}

filter { "configurations:Debug_* or Release_*" }
files {
path.getdirectory(os.getcwd()) .. "/src/ART.cpp",
path.getdirectory(os.getcwd()) .. "/src/Common/**.cpp",
path.getdirectory(os.getcwd()) .. "/src/Common/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/src",
path.getdirectory(os.getcwd()) .. "/src/Common",
}

filter {}

filter { "configurations:*_GUI" }
files {
path.getdirectory(os.getcwd()) .. "/src/GUI/**.cpp",
path.getdirectory(os.getcwd()) .. "/src/GUI/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/src/GUI",
}

filter {}

filter { "configurations:*_Headless" }
files {
path.getdirectory(os.getcwd()) .. "/src/Headless/**.cpp",
path.getdirectory(os.getcwd()) .. "/src/Headless/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/src/Headless",
}

filter {}

filter { "configurations:Test" }
files {
path.getdirectory(os.getcwd()) .. "/tests/**.cpp",
path.getdirectory(os.getcwd()) .. "/tests/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/tests"
}

filter {}

cdialect "C17"
cppdialect "C++17"
path.getdirectory(os.getcwd()) .. "/external",
path.getdirectory(os.getcwd()) .. "/lib",
path.getdirectory(os.getcwd()) .. "/lib/foundation",
path.getdirectory(os.getcwd()) .. "/lib/math",
path.getdirectory(os.getcwd()) .. "/lib/geometry",
path.getdirectory(os.getcwd()) .. "/lib/materials",
path.getdirectory(os.getcwd()) .. "/lib/raytracing",
path.getdirectory(os.getcwd()) .. "/lib/acceleration",
path.getdirectory(os.getcwd()) .. "/include",
}

filter { "configurations:*_GUI" }
externalincludedirs {
path.getdirectory(os.getcwd()) .. "/external/imgui/",
path.getdirectory(os.getcwd()) .. "/external/SDL3/include",
}

filter {}

filter { "system:windows", "platforms:x64", "configurations:*_GUI" }
libdirs { path.getdirectory(os.getcwd()) .. "/external/SDL3/lib/windows/x64" }
links { "SDL3" }
postbuildcommands {
'{COPYFILE} "%{wks.location}/external/SDL3/lib/windows/x64/SDL3.dll" "%{cfg.targetdir}"'
}

filter { "system:windows", "platforms:ARM64", "configurations:*_GUI" }
libdirs { path.getdirectory(os.getcwd()) .. "/external/SDL3/lib/windows/arm64" }
links { "SDL3" }
postbuildcommands {
'{COPYFILE} "%{wks.location}/external/SDL3/lib/windows/arm64/SDL3.dll" "%{cfg.targetdir}"'
}

filter { "system:linux", "configurations:*_GUI" }
links { "SDL3" }

filter {}

filter { "configurations:Debug_* or Release_*" }
files {
path.getdirectory(os.getcwd()) .. "/src/ART.cpp",
path.getdirectory(os.getcwd()) .. "/src/Common/**.cpp",
path.getdirectory(os.getcwd()) .. "/src/Common/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/src",
path.getdirectory(os.getcwd()) .. "/src/Common",
}

filter {}

filter { "configurations:*_GUI" }
files {
path.getdirectory(os.getcwd()) .. "/src/GUI/**.cpp",
path.getdirectory(os.getcwd()) .. "/src/GUI/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/src/GUI",
}

filter {}

filter { "configurations:*_Headless" }
files {
path.getdirectory(os.getcwd()) .. "/src/Headless/**.cpp",
path.getdirectory(os.getcwd()) .. "/src/Headless/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/src/Headless",
}

filter {}

filter { "configurations:Test" }
files {
path.getdirectory(os.getcwd()) .. "/tests/**.cpp",
path.getdirectory(os.getcwd()) .. "/tests/**.h",
}

externalincludedirs {
path.getdirectory(os.getcwd()) .. "/tests"
}

filter {}

cdialect "C17"
cppdialect "C++17"
1 change: 1 addition & 0 deletions lib/Core/ArenaAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <cstdint>
#include <new>
#include <string>
#include <utility>

#include <Core/Logger.h>
Expand Down
5 changes: 3 additions & 2 deletions lib/Core/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ double RenderStats::TotalTimeMilliseconds() const
void Init()
{
#if defined(_MSC_VER)
kmp_set_blocktime(0);

std::size_t num_openmp_threads = std::thread::hardware_concurrency();

if (num_openmp_threads <= 0)
{
num_openmp_threads = 1;
}
omp_set_num_threads(static_cast<int>(num_openmp_threads));

Logger::Get().LogInfo("Using " + std::to_string(num_openmp_threads) + " threads for render");
#endif // defined(_MSC_VER)
}

Expand Down
Loading