From 5426cc2e29084e2701d9dcb8e3b3ca567df09865 Mon Sep 17 00:00:00 2001 From: Dexrn ZacAttack Date: Fri, 23 Jan 2026 18:55:32 -0800 Subject: [PATCH] feat: start on WinRT --- CMakeLists.txt | 2 + projects/WinDurango.Kernel/CMakeLists.txt | 2 +- projects/WinDurango.WinRT/CMakeLists.txt | 37 +++++++++++++++++++ projects/WinDurango.WinRT/README.md | 5 +++ .../Storage/AbstractStorage.h | 17 +++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 projects/WinDurango.WinRT/CMakeLists.txt create mode 100644 projects/WinDurango.WinRT/README.md create mode 100644 projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f18f705..e720018 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,11 @@ project(WinDurango) set(CMAKE_CXX_STANDARD 17) add_subdirectory(projects/WinDurango.Common) +add_subdirectory(projects/WinDurango.WinRT) add_subdirectory(projects/WinDurango.Kernel) add_custom_target(WinDurango ALL DEPENDS WinDurango.Common + WinDurango.WinRT WinDurango.Kernel ) diff --git a/projects/WinDurango.Kernel/CMakeLists.txt b/projects/WinDurango.Kernel/CMakeLists.txt index 6d4a27d..3d8f624 100644 --- a/projects/WinDurango.Kernel/CMakeLists.txt +++ b/projects/WinDurango.Kernel/CMakeLists.txt @@ -14,7 +14,7 @@ target_include_directories(WinDurango.Kernel PUBLIC $ ) -target_link_libraries(WinDurango.Kernel PUBLIC WinDurango.Common) +target_link_libraries(WinDurango.Kernel PUBLIC WinDurango.Common WinDurango.WinRT) target_compile_definitions(WinDurango.Kernel PUBLIC WINDURANGO_KERNEL_COMPILER_NAME="${CMAKE_CXX_COMPILER_ID}" diff --git a/projects/WinDurango.WinRT/CMakeLists.txt b/projects/WinDurango.WinRT/CMakeLists.txt new file mode 100644 index 0000000..8d36a8f --- /dev/null +++ b/projects/WinDurango.WinRT/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 4.0) +project(WinDurango.WinRT VERSION 1.0.0) + +set(VERSION_SUFFIX "-dev.0") # used for non-stable versions, otherwise blank + +set(CMAKE_CXX_STANDARD 17) + +set(FILES + "include/WinDurango.WinRT/Storage/AbstractStorage.h" +) + +set(WINRT_USE_CROSS_PLATFORM OFF) + +add_library(WinDurango.WinRT SHARED ${FILES}) +target_include_directories(WinDurango.WinRT PUBLIC + $ +) + +target_link_libraries(WinDurango.WinRT PUBLIC WinDurango.Common) + +target_compile_definitions(WinDurango.WinRT PUBLIC + WINDURANGO_WINRT_COMPILER_NAME="${CMAKE_CXX_COMPILER_ID}" + WINDURANGO_WINRT_PLATFORM_NAME="${CMAKE_SYSTEM_NAME}" + WINDURANGO_WINRT_PLATFORM_ARCH="${CMAKE_SYSTEM_PROCESSOR}" + WINDURANGO_WINRT_VERSION="${PROJECT_VERSION}${VERSION_SUFFIX}" + WINDURANGO_WINRT_RC_VERSION=${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH} +) + +if (WINRT_USE_CROSS_PLATFORM STREQUAL ON) + target_compile_definitions(WinDurango.WinRT PUBLIC + WINRT_CROSS_PLATFORM) +endif() +unset(WINRT_USE_CROSS_PLATFORM CACHE) + +set_target_properties(WinDurango.WinRT PROPERTIES LINKER_LANGUAGE CXX) +# todo needed? +#set_target_properties(WinDurango.WinRT PROPERTIES LIBRARY_OUTPUT_NAME "winrt") \ No newline at end of file diff --git a/projects/WinDurango.WinRT/README.md b/projects/WinDurango.WinRT/README.md new file mode 100644 index 0000000..2351c3d --- /dev/null +++ b/projects/WinDurango.WinRT/README.md @@ -0,0 +1,5 @@ +# WinDurango.WinRT +Impls for various WinRT classes, somewhat prioritizing crossplat + +> [!IMPORTANT] +> When instantiating our classes, check for WINRT_CROSS_PLATFORM to determine which to instantiate. \ No newline at end of file diff --git a/projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h b/projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h new file mode 100644 index 0000000..fecb08c --- /dev/null +++ b/projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h @@ -0,0 +1,17 @@ +// +// Created by DexrnZacAttack on 1/23/26 using zPc-i2. +// +#ifndef WINDURANGO_ABSTRACTSTORAGE_H +#define WINDURANGO_ABSTRACTSTORAGE_H + +namespace wd::winrt { + /** Interface for storage management, to be impl'd for uwp and crossplat */ + class AbstractStorage { + public: + // todo can't make these static, what to do? + virtual void CreateFile(std::filesystem::path path) = 0; // todo maybe return stream type, todo can we use this in uwp context??? I forgor + virtual void CreateDirectory(std::filesystem::path path) = 0; + }; +} // wd::winrt + +#endif // WINDURANGO_ABSTRACTSTORAGE_H \ No newline at end of file