aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ezfoundation
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/ezfoundation')
-rw-r--r--vcpkg/ports/ezfoundation/ezFoundation_vcpkg.patch185
-rw-r--r--vcpkg/ports/ezfoundation/portfile.cmake62
-rw-r--r--vcpkg/ports/ezfoundation/vcpkg.json18
3 files changed, 265 insertions, 0 deletions
diff --git a/vcpkg/ports/ezfoundation/ezFoundation_vcpkg.patch b/vcpkg/ports/ezfoundation/ezFoundation_vcpkg.patch
new file mode 100644
index 0000000..f4b40c5
--- /dev/null
+++ b/vcpkg/ports/ezfoundation/ezFoundation_vcpkg.patch
@@ -0,0 +1,185 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a04be90..f853a0c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ cmake_minimum_required(VERSION 3.19)
+
++if(CMAKE_BUILD_TYPE STREQUAL Release)
++ set(CMAKE_BUILD_TYPE "Shipping" CACHE STRING "Release overridden with Shipping" FORCE)
++endif()
++
+ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+ message(FATAL_ERROR "In-source builds are not supported. Please choose a different binary directory.")
+ return()
+diff --git a/Code/Engine/CMakeLists.txt b/Code/Engine/CMakeLists.txt
+index fb4bef4..ccda93d 100644
+--- a/Code/Engine/CMakeLists.txt
++++ b/Code/Engine/CMakeLists.txt
+@@ -20,5 +20,3 @@ execute_process(
+ OUTPUT_VARIABLE EZ_GIT_BRANCH_NAME
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+-
+-configure_file("${CMAKE_CURRENT_LIST_DIR}/ezBuildInfo.h.in" "${CMAKE_CURRENT_LIST_DIR}/ezBuildInfo.h" NEWLINE_STYLE LF)
+\ No newline at end of file
+diff --git a/Code/Engine/Foundation/Basics/Assert.cpp b/Code/Engine/Foundation/Basics/Assert.cpp
+index 7a55afc..778fadd 100644
+--- a/Code/Engine/Foundation/Basics/Assert.cpp
++++ b/Code/Engine/Foundation/Basics/Assert.cpp
+@@ -66,16 +66,6 @@ bool ezDefaultAssertHandler(const char* szSourceFile, ezUInt32 uiLine, const cha
+
+ #if EZ_ENABLED(EZ_PLATFORM_WINDOWS)
+
+- // make sure the cursor is definitely shown, since the user must be able to click buttons
+-# if EZ_ENABLED(EZ_PLATFORM_WINDOWS_UWP)
+- // Todo: Use modern Windows API to show cursor in current window.
+- // http://stackoverflow.com/questions/37956628/change-mouse-pointer-in-uwp-app
+-# else
+- ezInt32 iHideCursor = 1;
+- while (ShowCursor(true) < 0)
+- ++iHideCursor;
+-# endif
+-
+ # if EZ_ENABLED(EZ_COMPILE_FOR_DEBUG)
+
+ ezInt32 iRes = _CrtDbgReport(_CRT_ASSERT, szSourceFile, uiLine, nullptr, "'%s'\nFunction: %s\nMessage: %s", szExpression, szFunction, szAssertMsg);
+@@ -83,24 +73,9 @@ bool ezDefaultAssertHandler(const char* szSourceFile, ezUInt32 uiLine, const cha
+ // currently we will ALWAYS trigger the breakpoint / crash (except for when the user presses 'ignore')
+ if (iRes == 0)
+ {
+- // when the user ignores the assert, restore the cursor show/hide state to the previous count
+-# if EZ_ENABLED(EZ_PLATFORM_WINDOWS_UWP)
+- // Todo: Use modern Windows API to restore cursor.
+-# else
+- for (ezInt32 i = 0; i < iHideCursor; ++i)
+- ShowCursor(false);
+-# endif
+-
+ return false;
+ }
+
+-# else
+-
+-
+-# if EZ_ENABLED(EZ_PLATFORM_WINDOWS_DESKTOP)
+- MessageBoxA(nullptr, szTemp, "Assertion", MB_ICONERROR);
+-# endif
+-
+ # endif
+
+ #endif
+diff --git a/Code/Engine/Foundation/Logging/Implementation/Log.cpp b/Code/Engine/Foundation/Logging/Implementation/Log.cpp
+index 1a0d2ed..afcde54 100644
+--- a/Code/Engine/Foundation/Logging/Implementation/Log.cpp
++++ b/Code/Engine/Foundation/Logging/Implementation/Log.cpp
+@@ -260,12 +260,7 @@ void ezLog::OsMessageBox(const ezFormatString& text)
+ title = ezApplication::GetApplicationInstance()->GetApplicationName();
+ }
+
+-#if EZ_ENABLED(EZ_PLATFORM_WINDOWS_DESKTOP)
+- MessageBoxW(nullptr, ezStringWChar(display).GetData(), ezStringWChar(title), MB_OK);
+-#else
+ ezLog::Print(display);
+- EZ_ASSERT_NOT_IMPLEMENTED;
+-#endif
+ }
+
+ void ezLog::GenerateFormattedTimestamp(TimestampMode mode, ezStringBuilder& sTimestampOut)
+diff --git a/Code/Engine/Foundation/Math/Implementation/Math_inl.h b/Code/Engine/Foundation/Math/Implementation/Math_inl.h
+index 1a2962e..9b31f01 100644
+--- a/Code/Engine/Foundation/Math/Implementation/Math_inl.h
++++ b/Code/Engine/Foundation/Math/Implementation/Math_inl.h
+@@ -80,6 +80,7 @@ namespace ezMath
+ #endif
+ }
+
++#if EZ_ENABLED(EZ_PLATFORM_64BIT)
+ EZ_ALWAYS_INLINE ezUInt32 FirstBitLow(ezUInt64 value)
+ {
+ EZ_ASSERT_DEBUG(value != 0, "FirstBitLow is undefined for 0");
+@@ -95,6 +96,7 @@ namespace ezMath
+ return 0;
+ #endif
+ }
++#endif
+
+ EZ_ALWAYS_INLINE ezUInt32 FirstBitHigh(ezUInt32 value)
+ {
+@@ -112,6 +114,7 @@ namespace ezMath
+ #endif
+ }
+
++#if EZ_ENABLED(EZ_PLATFORM_64BIT)
+ EZ_ALWAYS_INLINE ezUInt32 FirstBitHigh(ezUInt64 value)
+ {
+ EZ_ASSERT_DEBUG(value != 0, "FirstBitHigh is undefined for 0");
+@@ -127,6 +130,7 @@ namespace ezMath
+ return 0;
+ #endif
+ }
++#endif
+
+ EZ_ALWAYS_INLINE ezUInt32 CountTrailingZeros(ezUInt32 bitmask) { return (bitmask == 0) ? 32 : FirstBitLow(bitmask); }
+
+diff --git a/Code/Engine/Foundation/Memory/Implementation/AllocatorBase_inl.h b/Code/Engine/Foundation/Memory/Implementation/AllocatorBase_inl.h
+index fb839b3..21e2ec1 100644
+--- a/Code/Engine/Foundation/Memory/Implementation/AllocatorBase_inl.h
++++ b/Code/Engine/Foundation/Memory/Implementation/AllocatorBase_inl.h
+@@ -60,7 +60,11 @@ namespace ezInternal
+ template <typename T>
+ EZ_FORCE_INLINE T* CreateRawBuffer(ezAllocatorBase* pAllocator, size_t uiCount)
+ {
++#if EZ_ENABLED(EZ_PLATFORM_64BIT)
+ ezUInt64 safeAllocationSize = ezMath::SafeMultiply64(uiCount, sizeof(T));
++#else
++ ezUInt32 safeAllocationSize = ezMath::SafeMultiply32(uiCount, sizeof(T));
++#endif
+ return static_cast<T*>(pAllocator->Allocate(safeAllocationSize, EZ_ALIGNMENT_OF(T)));
+ }
+
+diff --git a/Code/Engine/Foundation/System/Implementation/Win/StackTracer_win.h b/Code/Engine/Foundation/System/Implementation/Win/StackTracer_win.h
+index 54939fb..15f928a 100644
+--- a/Code/Engine/Foundation/System/Implementation/Win/StackTracer_win.h
++++ b/Code/Engine/Foundation/System/Implementation/Win/StackTracer_win.h
+@@ -229,11 +229,23 @@ ezUInt32 ezStackTracer::GetStackTrace(ezArrayPtr<void*>& trace, void* pContext)
+ frame.AddrFrame.Offset = context.Rbp;
+ frame.AddrStack.Offset = context.Rsp;
+ machine_type = IMAGE_FILE_MACHINE_AMD64;
+-#else
++#elif defined(_M_IX86)
+ frame.AddrPC.Offset = context.Eip;
+ frame.AddrFrame.Offset = context.Ebp;
+ frame.AddrStack.Offset = context.Esp;
+ machine_type = IMAGE_FILE_MACHINE_I386;
++#elif defined(_M_ARM64)
++ frame.AddrPC.Offset = context.Pc;
++ frame.AddrFrame.Offset = context.Fp;
++ frame.AddrStack.Offset = context.Sp;
++ machine_type = IMAGE_FILE_MACHINE_ARM64;
++#elif defined(_M_ARM)
++ frame.AddrPC.Offset = context.Pc;
++ frame.AddrFrame.Offset = context.R11;
++ frame.AddrStack.Offset = context.Sp;
++ machine_type = IMAGE_FILE_MACHINE_ARM;
++#else
++ #error Unknown architecture
+ #endif
+ for (ezInt32 i = 0; i < (ezInt32)trace.GetCount(); i++)
+ {
+diff --git b/Code/Engine/ezBuildInfo.h b/Code/Engine/ezBuildInfo.h
+new file mode 100644
+index 0000000..763271c
+--- /dev/null
++++ b/Code/Engine/ezBuildInfo.h
+@@ -0,0 +1,10 @@
++//
++// This file is auto-generated by CMake.
++//
++
++#pragma once
++
++#define EZ_GIT_COMMIT_HASH_SHORT
++#define EZ_GIT_COMMIT_HASH_LONG
++#define EZ_GIT_BRANCH_NAME ""
++
diff --git a/vcpkg/ports/ezfoundation/portfile.cmake b/vcpkg/ports/ezfoundation/portfile.cmake
new file mode 100644
index 0000000..c93b438
--- /dev/null
+++ b/vcpkg/ports/ezfoundation/portfile.cmake
@@ -0,0 +1,62 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ezEngine/ezEngine
+ REF 1448308ab99bae0d8d2a292ad345ff3a757f3124 #21.10
+ SHA512 20da87772366d1612795f534b31600123c0d04beba252d27d895c3c3cff7dae65952bd890629d79a7a691c2f3444601552c4b4eca99e8f8a99dc935ce2ebd284
+ PATCHES
+ ezFoundation_vcpkg.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DEZ_3RDPARTY_ENET_SUPPORT=OFF
+ -DEZ_3RDPARTY_ZSTD_SUPPORT=OFF
+ -DEZ_3RDPARTY_ZLIB_SUPPORT=OFF
+ -DEZ_BUILD_FILTER=FoundationOnly
+ -DEZ_BUILD_UNITTESTS=OFF
+ -DEZ_ENABLE_FOLDER_UNITY_FILES=OFF
+ -DEZ_ENABLE_QT_SUPPORT=OFF
+ -DEZ_USE_PCH=OFF
+ OPTIONS_DEBUG
+ -DEZ_OUTPUT_DIRECTORY_LIB=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Output/Lib
+ -DEZ_OUTPUT_DIRECTORY_DLL=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Output/Bin
+ OPTIONS_RELEASE
+ -DEZ_OUTPUT_DIRECTORY_LIB=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Output/Lib
+ -DEZ_OUTPUT_DIRECTORY_DLL=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Output/Bin
+)
+
+vcpkg_cmake_build(TARGET Foundation)
+
+# EzEngine does not support CMake-based install; copy headers and libraries manually.
+file(GLOB_RECURSE FOUNDATION_INCLUDE_FILES RELATIVE "${SOURCE_PATH}/Code/Engine/Foundation" "${SOURCE_PATH}/Code/Engine/Foundation/*.h")
+foreach(SOURCE_FILE ${FOUNDATION_INCLUDE_FILES})
+ get_filename_component(SOURCE_FILE_DIR "${SOURCE_FILE}" DIRECTORY)
+ if(SOURCE_FILE_DIR STREQUAL "")
+ set(TARGET_DIR "${CURRENT_PACKAGES_DIR}/include/Foundation")
+ else()
+ set(TARGET_DIR "${CURRENT_PACKAGES_DIR}/include/Foundation/${SOURCE_FILE_DIR}")
+ endif()
+ file(COPY "${SOURCE_PATH}/Code/Engine/Foundation/${SOURCE_FILE}" DESTINATION "${TARGET_DIR}")
+endforeach()
+
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
+ set(LIB_SOURCE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Output/Lib")
+ set(LIB_TARGET_DIR "${CURRENT_PACKAGES_DIR}/debug/lib")
+ file(GLOB_RECURSE LIB_FILES "${LIB_SOURCE_DIR}/*.lib")
+ foreach(LIB_FILE ${LIB_FILES})
+ file(COPY "${LIB_FILE}" DESTINATION "${LIB_TARGET_DIR}")
+ endforeach()
+endif()
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
+ set(LIB_SOURCE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Output/Lib")
+ set(LIB_TARGET_DIR "${CURRENT_PACKAGES_DIR}/lib")
+ file(GLOB_RECURSE LIB_FILES "${LIB_SOURCE_DIR}/*.lib")
+ foreach(LIB_FILE ${LIB_FILES})
+ file(COPY "${LIB_FILE}" DESTINATION "${LIB_TARGET_DIR}")
+ endforeach()
+endif()
+
+file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/ezfoundation/vcpkg.json b/vcpkg/ports/ezfoundation/vcpkg.json
new file mode 100644
index 0000000..6b60fd2
--- /dev/null
+++ b/vcpkg/ports/ezfoundation/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "ezfoundation",
+ "version": "21.10",
+ "description": "Foundation library out of ezEngine",
+ "homepage": "https://ezengine.net/",
+ "license": "MIT",
+ "supports": "windows | uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}