jpbruyere / vkvg

Vulkan 2D graphics library
https://jpbruyere.github.io/vkvg/
MIT License
773 stars 33 forks source link

fix for compilation issues due to -ansi switch removing 'alignas' keyword on UNIX or Android #138

Closed ar-visions closed 1 year ago

ar-visions commented 1 year ago

CMakeLists.txt

Removing the -ansi lets it compile, otherwise strict ansi mode, on clang, removes the keyword 'alignas' causing a compilation issue in the vk_mem_alloc.

ar-visions commented 1 year ago

actual diff as compared to main:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02a879c..fa9a34e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,9 +49,9 @@ ELSE()
    UNSET(VKVG_WIRED_FILL CACHE)
    UNSET(VKVG_USE_MESA_OVERLAY CACHE)
    IF (ANDROID)
-       ADD_COMPILE_OPTIONS(-O3 -w -ansi -pedantic)
+       ADD_COMPILE_OPTIONS(-O3 -w -pedantic)
    ELSEIF (UNIX)       
-       ADD_COMPILE_OPTIONS(-O3 -w -ansi -pedantic -fvisibility=hidden -fno-rtti)
+       ADD_COMPILE_OPTIONS(-O3 -w -pedantic -fvisibility=hidden -fno-rtti)
        #ADD_COMPILE_OPTIONS(-flto -pthread -lpthread -Wl,--no-as-needed)
    ELSEIF(MSVC)
        ADD_COMPILE_OPTIONS(/O2 /TC /W0 /Od)
jpbruyere commented 1 year ago

I've merged from a local temp branch into master, thanks for the report.

ar-visions commented 1 year ago

This is the best vector library ever made, thanks to your great work! Just 1/20th size of skia and better performance. I wish to thank you.