From: Geoff Lang Date: Tue, 16 May 2023 15:59:30 +0000 (-0400) Subject: Don't export Vulkan functions when building the loader statically X-Git-Tag: upstream/1.3.268~175 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=823209c89e86d7b9dd7becb7085aa9cd9a34961c;p=platform%2Fupstream%2FVulkan-Loader.git Don't export Vulkan functions when building the loader statically If the loader is linked statically, there is no need to export all vulkan functions from the linking application. This issue showed up in ANGLE which would export all GLES and Vulkan functions on Mac. --- diff --git a/BUILD.gn b/BUILD.gn index 5790e753..2f0b2a60 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -62,6 +62,9 @@ config("vulkan_internal_config") { "FALLBACK_DATA_DIRS=\"/usr/local/share:/usr/share\"", ] } + if (!vulkan_loader_shared) { + defines += [ "BUILD_STATIC_LOADER" ] + } } # Vulkan loader diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index c68f9180..2e0c98ed 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -76,7 +76,9 @@ #include "stack_allocation.h" -#if defined(__GNUC__) && __GNUC__ >= 4 +#if defined(BUILD_STATIC_LOADER) +#define LOADER_EXPORT +#elif defined(__GNUC__) && __GNUC__ >= 4 #define LOADER_EXPORT __attribute__((visibility("default"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) #define LOADER_EXPORT __attribute__((visibility("default")))