From da5b9686baef62a3bce3d4cf3950962c4cb6457f Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Wed, 26 Nov 2025 22:05:02 +0800 Subject: [PATCH] [Fix]: build on macOS --- CMakeLists.txt | 4 +++- .../GLState/TextureState/TextureObject.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 004df90f..2adb7e21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,13 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR MOBILEGL_FORCE_RELEASE_OPT) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) endif() - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT MATCHES "AppleClang") add_compile_options(-O3 -ffunction-sections -fdata-sections) add_link_options(-Wl,--gc-sections) elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") add_compile_options(/O2 /GL) + else () + add_compile_options(-O3) endif() endif() diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject.h b/MobileGL/MG_State/GLState/TextureState/TextureObject.h index 89860857..60a0052f 100644 --- a/MobileGL/MG_State/GLState/TextureState/TextureObject.h +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject.h @@ -48,14 +48,14 @@ namespace MobileGL { virtual ~TextureObjectBase() = default; // Mipmap ops - Uint GetMipmapLevelCount() const = 0; - const IntVec3 GetMipmapTexelSize(TextureUploadTarget target, Uint mipmapLevel) const = 0; - const SizeT GetMipmapByteSize(TextureUploadTarget target, Uint mipmapLevel) const = 0; - void AllocateStorage(TextureUploadTarget uploadTarget, Uint mipmapLevel, MipmapInput input) = 0; - void UpdateMipmapSubData(TextureUploadTarget uploadTarget, Uint mipmapLevel, DataPtr input) = 0; - void* MapMipmapData(TextureUploadTarget uploadTarget, Uint mipmapLevel) = 0; - void MarkStorageDirty(TextureUploadTarget uploadTarget, Uint mipmapLevel, bool dirty) = 0; - bool IsStorageDirty(TextureUploadTarget uploadTarget, Uint mipmapLevel) const = 0; +// Uint GetMipmapLevelCount() const = 0; +// const IntVec3 GetMipmapTexelSize(TextureUploadTarget target, Uint mipmapLevel) const = 0; +// const SizeT GetMipmapByteSize(TextureUploadTarget target, Uint mipmapLevel) const = 0; +// void AllocateStorage(TextureUploadTarget uploadTarget, Uint mipmapLevel, MipmapInput input) = 0; +// void UpdateMipmapSubData(TextureUploadTarget uploadTarget, Uint mipmapLevel, DataPtr input) = 0; +// void* MapMipmapData(TextureUploadTarget uploadTarget, Uint mipmapLevel) = 0; +// void MarkStorageDirty(TextureUploadTarget uploadTarget, Uint mipmapLevel, bool dirty) = 0; +// bool IsStorageDirty(TextureUploadTarget uploadTarget, Uint mipmapLevel) const = 0; TextureInternalFormat GetFormat() const override; TextureTarget GetTarget() const override;