Prepped for NixOS with clang.
This commit is contained in:
parent
14f4ac39be
commit
a3dcf22fa5
|
|
@ -2,3 +2,4 @@
|
||||||
.cache/
|
.cache/
|
||||||
build/
|
build/
|
||||||
.vs/
|
.vs/
|
||||||
|
.direnv/
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,22 @@
|
||||||
"rhs": "Linux"
|
"rhs": "Linux"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nixos",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
|
||||||
|
"CMAKE_MAKE_PROGRAM": "ninja",
|
||||||
|
"CMAKE_C_COMPILER": "$env{CC}",
|
||||||
|
"CMAKE_CXX_COMPILER": "$env{CXX}"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Linux"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "windows-debug",
|
"name": "windows-debug",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
|
|
|
||||||
8
run.sh
8
run.sh
|
|
@ -1,12 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -d "out" ]; then
|
if [ -d "build" ]; then
|
||||||
pushd ./build/ > /dev/null || exit
|
pushd ./build/samples/04_scenes/ > /dev/null || exit
|
||||||
if echo "$@" | grep -e "debug" -q
|
if echo "$@" | grep -e "debug" -q
|
||||||
then
|
then
|
||||||
lldb aster-exe
|
lldb ./scene_render
|
||||||
else
|
else
|
||||||
./aster-exe
|
./scene_render
|
||||||
fi
|
fi
|
||||||
popd > /dev/null || exit
|
popd > /dev/null || exit
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ Init(const Context *context, const Device *device, const Window *window, vk::For
|
||||||
CreateContext();
|
CreateContext();
|
||||||
ImGuiIO &io = GetIO();
|
ImGuiIO &io = GetIO();
|
||||||
(void)io;
|
(void)io;
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
// io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||||
// io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Viewports bad
|
// io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Viewports bad
|
||||||
|
|
||||||
StyleColorsDark();
|
StyleColorsDark();
|
||||||
|
|
@ -108,16 +108,16 @@ StartBuild()
|
||||||
ImGui_ImplGlfw_NewFrame();
|
ImGui_ImplGlfw_NewFrame();
|
||||||
NewFrame();
|
NewFrame();
|
||||||
|
|
||||||
static ImGuiDockNodeFlags dockspaceFlags = ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_PassthruCentralNode;
|
// static ImGuiDockNodeFlags dockspaceFlags = ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_PassthruCentralNode;
|
||||||
|
|
||||||
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
||||||
// because it would be confusing to have two docking targets within each others.
|
// because it would be confusing to have two docking targets within each others.
|
||||||
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoDocking;
|
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_None; // ImGuiWindowFlags_NoDocking;
|
||||||
|
|
||||||
const ImGuiViewport *viewport = GetMainViewport();
|
const ImGuiViewport *viewport = GetMainViewport();
|
||||||
SetNextWindowPos(viewport->WorkPos);
|
SetNextWindowPos(viewport->WorkPos);
|
||||||
SetNextWindowSize(viewport->WorkSize);
|
SetNextWindowSize(viewport->WorkSize);
|
||||||
SetNextWindowViewport(viewport->ID);
|
// SetNextWindowViewport(viewport->ID);
|
||||||
PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
||||||
PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
||||||
windowFlags |=
|
windowFlags |=
|
||||||
|
|
@ -130,18 +130,18 @@ StartBuild()
|
||||||
// all active windows docked into it will lose their parent and become undocked.
|
// all active windows docked into it will lose their parent and become undocked.
|
||||||
// We cannot preserve the docking relationship between an active window and an inactive docking, otherwise
|
// We cannot preserve the docking relationship between an active window and an inactive docking, otherwise
|
||||||
// any change of dockspace/settings would lead to windows being stuck in limbo and never being visible.
|
// any change of dockspace/settings would lead to windows being stuck in limbo and never being visible.
|
||||||
PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
// PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
||||||
Begin("DockSpace Demo", nullptr, windowFlags);
|
// Begin("DockSpace Demo", nullptr, windowFlags);
|
||||||
PopStyleVar();
|
// PopStyleVar();
|
||||||
|
|
||||||
PopStyleVar(2);
|
// PopStyleVar(2);
|
||||||
|
|
||||||
// DockSpace
|
// DockSpace
|
||||||
if (GetIO().ConfigFlags & ImGuiConfigFlags_DockingEnable)
|
// if (GetIO().ConfigFlags & ImGuiConfigFlags_DockingEnable)
|
||||||
{
|
// {
|
||||||
const ImGuiID dockspaceId = GetID("MyDockSpace");
|
// const ImGuiID dockspaceId = GetID("MyDockSpace");
|
||||||
DockSpace(dockspaceId, ImVec2(0.0f, 0.0f), dockspaceFlags);
|
// DockSpace(dockspaceId, ImVec2(0.0f, 0.0f), dockspaceFlags);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -151,13 +151,13 @@ EndBuild()
|
||||||
Render();
|
Render();
|
||||||
|
|
||||||
EndFrame();
|
EndFrame();
|
||||||
if (GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
// if (GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
||||||
{
|
// {
|
||||||
GLFWwindow *backupCurrentContext = glfwGetCurrentContext();
|
// GLFWwindow *backupCurrentContext = glfwGetCurrentContext();
|
||||||
UpdatePlatformWindows();
|
// UpdatePlatformWindows();
|
||||||
RenderPlatformWindowsDefault();
|
// RenderPlatformWindowsDefault();
|
||||||
glfwMakeContextCurrent(backupCurrentContext);
|
// glfwMakeContextCurrent(backupCurrentContext);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -753,8 +753,8 @@ AssetLoader::ProcessNode(tinygltf::Model *model, eastl::vector<vec4> *vertexPosi
|
||||||
entities->push_back(entity);
|
entities->push_back(entity);
|
||||||
|
|
||||||
m_Registry->emplace<CMesh>(entity, CMesh{
|
m_Registry->emplace<CMesh>(entity, CMesh{
|
||||||
.m_VertexPositionPtr = vertexOffset * sizeof vec4,
|
.m_VertexPositionPtr = vertexOffset * sizeof(vec4),
|
||||||
.m_VertexDataPtr = vertexOffset * sizeof VertexData,
|
.m_VertexDataPtr = vertexOffset * sizeof(VertexData),
|
||||||
.m_FirstIndex = indexOffset,
|
.m_FirstIndex = indexOffset,
|
||||||
.m_IndexCount = indexCount,
|
.m_IndexCount = indexCount,
|
||||||
});
|
});
|
||||||
|
|
@ -764,7 +764,7 @@ AssetLoader::ProcessNode(tinygltf::Model *model, eastl::vector<vec4> *vertexPosi
|
||||||
m_Registry->emplace<CParent<CDynamicTransform>>(entity, nodeRoot);
|
m_Registry->emplace<CParent<CDynamicTransform>>(entity, nodeRoot);
|
||||||
if (prim.material >= 0)
|
if (prim.material >= 0)
|
||||||
{
|
{
|
||||||
m_Registry->emplace<CMaterial>(entity, sizeof Material * loadMaterial(prim.material));
|
m_Registry->emplace<CMaterial>(entity, sizeof(Material) * loadMaterial(prim.material));
|
||||||
m_Registry->emplace<CRequiresPostLoadProcess<CMaterial>>(entity);
|
m_Registry->emplace<CRequiresPostLoadProcess<CMaterial>>(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
let eabase = pkgs.callPackage ./vendored-nix/eabase {}; in
|
||||||
|
let eastl = pkgs.callPackage ./vendored-nix/eastl { inherit eabase; }; in
|
||||||
|
let tinygltf = pkgs.callPackage ./vendored-nix/tinygltf {}; in
|
||||||
|
let debugbreak = pkgs.callPackage ./vendored-nix/scottt-debugbreak {}; in
|
||||||
|
|
||||||
|
pkgs.clangStdenv.mkDerivation {
|
||||||
|
name = "aster-env";
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
|
(imgui.override {IMGUI_BUILD_VULKAN_BINDING = true; IMGUI_BUILD_GLFW_BINDING=true; })
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
glm
|
||||||
|
glfw3
|
||||||
|
eastl
|
||||||
|
fmt
|
||||||
|
eabase
|
||||||
|
eastl
|
||||||
|
entt
|
||||||
|
tinygltf
|
||||||
|
debugbreak
|
||||||
|
stb
|
||||||
|
|
||||||
|
# vulkan
|
||||||
|
vulkan-headers
|
||||||
|
vulkan-loader
|
||||||
|
vulkan-validation-layers
|
||||||
|
vulkan-memory-allocator
|
||||||
|
directx-shader-compiler
|
||||||
|
glslang
|
||||||
|
shaderc
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
From 56d58f6863feafa1fccddbe1d828bad2aa9d62e3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: kidrigger <rex16saddler@gmail.com>
|
||||||
|
Date: Sat, 1 Feb 2025 23:20:58 +0100
|
||||||
|
Subject: [PATCH] Fix Installation and add Config.
|
||||||
|
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 61 ++++++++++++++++++++++++++++++++++---------
|
||||||
|
EABaseConfig.cmake.in | 6 +++++
|
||||||
|
2 files changed, 55 insertions(+), 12 deletions(-)
|
||||||
|
create mode 100644 EABaseConfig.cmake.in
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 652f07f..933b113 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -4,6 +4,9 @@
|
||||||
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
project(EABase CXX)
|
||||||
|
|
||||||
|
+include(GNUInstallDirs)
|
||||||
|
+include(CMakePackageConfigHelpers)
|
||||||
|
+
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
# Options
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
@@ -21,17 +24,51 @@ endif()
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
add_definitions(-D_CHAR16T)
|
||||||
|
|
||||||
|
-#-------------------------------------------------------------------------------------------
|
||||||
|
-# Header only library
|
||||||
|
-#-------------------------------------------------------------------------------------------
|
||||||
|
-add_library(EABase INTERFACE)
|
||||||
|
+if (NOT EABASE_BUILD_TESTS)
|
||||||
|
+ #-------------------------------------------------------------------------------------------
|
||||||
|
+ # Header only library
|
||||||
|
+ #-------------------------------------------------------------------------------------------
|
||||||
|
+ add_library(EABase INTERFACE)
|
||||||
|
+ add_library(EABase::EABase ALIAS EABase)
|
||||||
|
|
||||||
|
-#-------------------------------------------------------------------------------------------
|
||||||
|
-# Include dirs
|
||||||
|
-#-------------------------------------------------------------------------------------------
|
||||||
|
-target_include_directories(EABase INTERFACE include/Common)
|
||||||
|
+ #-------------------------------------------------------------------------------------------
|
||||||
|
+ # Include dirs
|
||||||
|
+ #-------------------------------------------------------------------------------------------
|
||||||
|
+ target_include_directories(EABase INTERFACE
|
||||||
|
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/Common>
|
||||||
|
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
|
+ )
|
||||||
|
|
||||||
|
-#-------------------------------------------------------------------------------------------
|
||||||
|
-# Installation
|
||||||
|
-#-------------------------------------------------------------------------------------------
|
||||||
|
-install(DIRECTORY include/Common/EABase DESTINATION include)
|
||||||
|
+ # create and install an export set for eabase target as EABase::EABase
|
||||||
|
+ set(EABase_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/EABase")
|
||||||
|
+
|
||||||
|
+ configure_package_config_file(
|
||||||
|
+ EABaseConfig.cmake.in
|
||||||
|
+ ${CMAKE_CURRENT_BINARY_DIR}/EABaseConfig.cmake
|
||||||
|
+ INSTALL_DESTINATION ${EABase_CMAKE_CONFIG_DESTINATION}
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
+ # create and install an export set for Terra target as Terra
|
||||||
|
+ install(
|
||||||
|
+ TARGETS EABase EXPORT EABaseTargets
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
+ install(EXPORT EABaseTargets DESTINATION ${EABase_CMAKE_CONFIG_DESTINATION})
|
||||||
|
+
|
||||||
|
+ write_basic_package_version_file(
|
||||||
|
+ "${CMAKE_CURRENT_BINARY_DIR}/EABaseConfigVersion.cmake"
|
||||||
|
+ VERSION 2.09.12
|
||||||
|
+ COMPATIBILITY SameMajorVersion
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
+ install(TARGETS EABase LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
+ install(DIRECTORY "include/Common/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||||
|
+
|
||||||
|
+ install(
|
||||||
|
+ FILES
|
||||||
|
+ "${CMAKE_CURRENT_BINARY_DIR}/EABaseConfig.cmake"
|
||||||
|
+ "${CMAKE_CURRENT_BINARY_DIR}/EABaseConfigVersion.cmake"
|
||||||
|
+ DESTINATION ${EABase_CMAKE_CONFIG_DESTINATION}
|
||||||
|
+ )
|
||||||
|
+endif()
|
||||||
|
diff --git a/EABaseConfig.cmake.in b/EABaseConfig.cmake.in
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..afc9b10
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/EABaseConfig.cmake.in
|
||||||
|
@@ -0,0 +1,6 @@
|
||||||
|
+@PACKAGE_INIT@
|
||||||
|
+
|
||||||
|
+# Provide path for scripts
|
||||||
|
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
+
|
||||||
|
+include(${CMAKE_CURRENT_LIST_DIR}/EABaseTargets.cmake)
|
||||||
|
\ No newline at end of file
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ stdenv, fetchFromGitHub, cmake }:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "eabase";
|
||||||
|
version = "2.09.06";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "electronicarts";
|
||||||
|
repo = "EABase";
|
||||||
|
rev = "123363eb82e132c0181ac53e43226d8ee76dea12";
|
||||||
|
sha256 = "sha256-tQcGoOeyptMf/KQGC+o9P6XiTfJhi0xjwB2M/3JtnW4=";
|
||||||
|
fetchSubmodules = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [ ./cmake_install_fix.patch ];
|
||||||
|
|
||||||
|
# buildPhase = ''
|
||||||
|
# runHook preBuild
|
||||||
|
# cp ${cmakeConfigFile} $build/
|
||||||
|
# runHook postBuild
|
||||||
|
# '';
|
||||||
|
|
||||||
|
# installPhase = ''
|
||||||
|
# runHook preInstall
|
||||||
|
# mkdir -p $out
|
||||||
|
# cmake --install . --prefix $out/
|
||||||
|
# runHook postInstall
|
||||||
|
# '';
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
{ stdenv, fetchFromGitHub, cmake, ninja, eabase }:
|
||||||
|
let buildFolder = "out/"; in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "eastl";
|
||||||
|
version = "3.21.23";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "electronicarts";
|
||||||
|
repo = "EASTL";
|
||||||
|
rev = "3.21.23";
|
||||||
|
sha256 = "sha256-8imixecWN/FOHY/9IxkIMbkxK7NXZ0TecZ4/SvOqf14=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./fix-cmake-install.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
mkdir -p ${buildFolder}
|
||||||
|
pushd ${buildFolder}
|
||||||
|
cmake .. -GNinja -DEASTL_BUILD_TESTS:BOOL=OFF -DEASTL_BUILD_BENCHMARK:BOOL=OFF -DCMAKE_PREFIX_PATH=${eabase}
|
||||||
|
popd
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
pushd ${buildFolder}
|
||||||
|
cmake --build . --config Release
|
||||||
|
popd
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
pushd ${buildFolder}
|
||||||
|
cmake --install . --prefix $out
|
||||||
|
rm $out/lib64/libEASTL.a
|
||||||
|
popd
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
From 133f26c80a5e79f66769d33e2d01252d12016e69 Mon Sep 17 00:00:00 2001
|
||||||
|
From: kidrigger <rex16saddler@gmail.com>
|
||||||
|
Date: Sat, 1 Feb 2025 23:30:50 +0100
|
||||||
|
Subject: [PATCH] Fix installation and VCPKG patch.
|
||||||
|
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 49 ++++++++++++++++++++++++------
|
||||||
|
EASTLConfig.cmake.in | 9 ++++++
|
||||||
|
scripts/CMake/CommonCppFlags.cmake | 3 ++
|
||||||
|
3 files changed, 52 insertions(+), 9 deletions(-)
|
||||||
|
create mode 100644 EASTLConfig.cmake.in
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index a5870f8..fd64807 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -5,6 +5,9 @@ cmake_minimum_required(VERSION 3.11)
|
||||||
|
include(FetchContent)
|
||||||
|
project(EASTL CXX)
|
||||||
|
|
||||||
|
+include(GNUInstallDirs)
|
||||||
|
+include(CMakePackageConfigHelpers)
|
||||||
|
+
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
# Options
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
@@ -12,7 +15,6 @@ option(EASTL_BUILD_BENCHMARK "Enable generation of build files for benchmark" OF
|
||||||
|
option(EASTL_BUILD_TESTS "Enable generation of build files for tests" OFF)
|
||||||
|
option(EASTL_STD_ITERATOR_CATEGORY_ENABLED "Enable compatibility with std:: iterator categories" OFF)
|
||||||
|
|
||||||
|
-
|
||||||
|
option(EASTL_DISABLE_APRIL_2024_DEPRECATIONS "Enable use of API marked for removal in April 2024." OFF)
|
||||||
|
option(EASTL_DISABLE_SEPT_2024_DEPRECATIONS "Enable use of API marked for removal in September 2024." OFF)
|
||||||
|
option(EASTL_DISABLE_APRIL_2025_DEPRECATIONS "Enable use of API marked for removal in April 2025." OFF)
|
||||||
|
@@ -65,21 +67,50 @@ endif()
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
# Include dirs
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
-target_include_directories(EASTL PUBLIC include)
|
||||||
|
+target_include_directories(EASTL PUBLIC
|
||||||
|
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
|
||||||
|
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
|
+ )
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
# Dependencies
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
-FetchContent_Declare(
|
||||||
|
- EABase
|
||||||
|
- GIT_REPOSITORY https://github.com/electronicarts/EABase.git
|
||||||
|
- GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12
|
||||||
|
- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
|
||||||
|
+find_package(EABase CONFIG REQUIRED)
|
||||||
|
+target_link_libraries(EASTL PUBLIC EABase)
|
||||||
|
+
|
||||||
|
+# create and install an export set for eabase target as EABase::EABase
|
||||||
|
+set(EASTL_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/EASTL")
|
||||||
|
+
|
||||||
|
+configure_package_config_file(
|
||||||
|
+ EASTLConfig.cmake.in
|
||||||
|
+ ${CMAKE_CURRENT_BINARY_DIR}/EASTLConfig.cmake
|
||||||
|
+ INSTALL_DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION}
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+# create and install an export set for Terra target as Terra
|
||||||
|
+install(
|
||||||
|
+ TARGETS EASTL EXPORT EASTLTargets
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+install(EXPORT EASTLTargets DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION})
|
||||||
|
+
|
||||||
|
+write_basic_package_version_file(
|
||||||
|
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfigVersion.cmake"
|
||||||
|
+ VERSION 3.16.05
|
||||||
|
+ COMPATIBILITY SameMajorVersion
|
||||||
|
)
|
||||||
|
|
||||||
|
-FetchContent_MakeAvailable(EABase)
|
||||||
|
+install(TARGETS EASTL LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
+install(DIRECTORY "include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||||
|
|
||||||
|
-target_link_libraries(EASTL EABase)
|
||||||
|
+install(
|
||||||
|
+ FILES
|
||||||
|
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfig.cmake"
|
||||||
|
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfigVersion.cmake"
|
||||||
|
+ DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION}
|
||||||
|
+)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------------------
|
||||||
|
# Deprecations
|
||||||
|
diff --git a/EASTLConfig.cmake.in b/EASTLConfig.cmake.in
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..92fb2b1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/EASTLConfig.cmake.in
|
||||||
|
@@ -0,0 +1,9 @@
|
||||||
|
+@PACKAGE_INIT@
|
||||||
|
+
|
||||||
|
+include(CMakeFindDependencyMacro)
|
||||||
|
+find_dependency(EABase CONFIG REQUIRED)
|
||||||
|
+
|
||||||
|
+# Provide path for scripts
|
||||||
|
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
+
|
||||||
|
+include(${CMAKE_CURRENT_LIST_DIR}/EASTLTargets.cmake)
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/scripts/CMake/CommonCppFlags.cmake b/scripts/CMake/CommonCppFlags.cmake
|
||||||
|
index 08b6af5..281665e 100644
|
||||||
|
--- a/scripts/CMake/CommonCppFlags.cmake
|
||||||
|
+++ b/scripts/CMake/CommonCppFlags.cmake
|
||||||
|
@@ -74,6 +74,9 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest /W4 /permissive-")
|
||||||
|
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.31.30911.95")
|
||||||
|
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:static_assert-")
|
||||||
|
+ endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{ stdenv, fetchFromGitHub}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "scottt-debugbreak";
|
||||||
|
version = "1.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "scottt";
|
||||||
|
repo = "debugbreak";
|
||||||
|
rev = "v1.0";
|
||||||
|
sha256 = "sha256-lFMBSbA4mwAgW/+T+G1pfrwYjcZFuoKr6t8JYMB65Yw=";
|
||||||
|
fetchSubmodules = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
mkdir -p $out/include
|
||||||
|
cp debugbreak.h $out/include
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ stdenv, fetchFromGitHub, cmake }:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "tinygltf";
|
||||||
|
version = "2.9.5";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
];
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "syoyo";
|
||||||
|
repo = "tinygltf";
|
||||||
|
rev = "v2.9.5";
|
||||||
|
sha256 = "sha256-7GsLdjOAZvi/Lqu7mTWwvQTa5WokbGQlHy/CPoHipD8=";
|
||||||
|
fetchSubmodules = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue