fix: hide symbols by default

This commit is contained in:
PancakeTAS 2025-07-30 17:46:39 +02:00
parent 61be74fe18
commit 60ccaac64d
No known key found for this signature in database
6 changed files with 20 additions and 1 deletions

View file

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
set(CMAKE_SKIP_RPATH ON) set(CMAKE_SKIP_RPATH ON)
set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
# subprojects # subprojects
add_compile_options(-fPIC add_compile_options(-fPIC

View file

@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
project(lsfg-vk-framegen project(lsfg-vk-framegen
DESCRIPTION "Lossless Scaling Frame Generation Backend" DESCRIPTION "Lossless Scaling Frame Generation Backend"
LANGUAGES CXX) LANGUAGES CXX)

View file

@ -20,6 +20,7 @@ namespace LSFG_3_1 {
/// ///
/// @throws LSFG::vulkan_error if Vulkan objects fail to initialize. /// @throws LSFG::vulkan_error if Vulkan objects fail to initialize.
/// ///
__attribute__((visibility("default")))
void initialize(uint64_t deviceUUID, void initialize(uint64_t deviceUUID,
bool isHdr, float flowScale, uint64_t generationCount, bool isHdr, float flowScale, uint64_t generationCount,
const std::function<std::vector<uint8_t>(const std::string&)>& loader); const std::function<std::vector<uint8_t>(const std::string&)>& loader);
@ -36,6 +37,7 @@ namespace LSFG_3_1 {
/// ///
/// @throws LSFG::vulkan_error if the context cannot be created. /// @throws LSFG::vulkan_error if the context cannot be created.
/// ///
__attribute__((visibility("default")))
int32_t createContext( int32_t createContext(
int in0, int in1, const std::vector<int>& outN, int in0, int in1, const std::vector<int>& outN,
VkExtent2D extent, VkFormat format); VkExtent2D extent, VkFormat format);
@ -49,6 +51,7 @@ namespace LSFG_3_1 {
/// ///
/// @throws LSFG::vulkan_error if the context cannot be presented. /// @throws LSFG::vulkan_error if the context cannot be presented.
/// ///
__attribute__((visibility("default")))
void presentContext(int32_t id, int inSem, const std::vector<int>& outSem); void presentContext(int32_t id, int inSem, const std::vector<int>& outSem);
/// ///
@ -56,11 +59,13 @@ namespace LSFG_3_1 {
/// ///
/// @param id Unique identifier of the context to delete. /// @param id Unique identifier of the context to delete.
/// ///
__attribute__((visibility("default")))
void deleteContext(int32_t id); void deleteContext(int32_t id);
/// ///
/// Deinitialize the LSFG library. /// Deinitialize the LSFG library.
/// ///
__attribute__((visibility("default")))
void finalize(); void finalize();
} }

View file

@ -20,6 +20,7 @@ namespace LSFG_3_1P {
/// ///
/// @throws LSFG::vulkan_error if Vulkan objects fail to initialize. /// @throws LSFG::vulkan_error if Vulkan objects fail to initialize.
/// ///
__attribute__((visibility("default")))
void initialize(uint64_t deviceUUID, void initialize(uint64_t deviceUUID,
bool isHdr, float flowScale, uint64_t generationCount, bool isHdr, float flowScale, uint64_t generationCount,
const std::function<std::vector<uint8_t>(const std::string&)>& loader); const std::function<std::vector<uint8_t>(const std::string&)>& loader);
@ -36,6 +37,7 @@ namespace LSFG_3_1P {
/// ///
/// @throws LSFG::vulkan_error if the context cannot be created. /// @throws LSFG::vulkan_error if the context cannot be created.
/// ///
__attribute__((visibility("default")))
int32_t createContext( int32_t createContext(
int in0, int in1, const std::vector<int>& outN, int in0, int in1, const std::vector<int>& outN,
VkExtent2D extent, VkFormat format); VkExtent2D extent, VkFormat format);
@ -49,6 +51,7 @@ namespace LSFG_3_1P {
/// ///
/// @throws LSFG::vulkan_error if the context cannot be presented. /// @throws LSFG::vulkan_error if the context cannot be presented.
/// ///
__attribute__((visibility("default")))
void presentContext(int32_t id, int inSem, const std::vector<int>& outSem); void presentContext(int32_t id, int inSem, const std::vector<int>& outSem);
/// ///
@ -56,11 +59,13 @@ namespace LSFG_3_1P {
/// ///
/// @param id Unique identifier of the context to delete. /// @param id Unique identifier of the context to delete.
/// ///
__attribute__((visibility("default")))
void deleteContext(int32_t id); void deleteContext(int32_t id);
/// ///
/// Deinitialize the LSFG library. /// Deinitialize the LSFG library.
/// ///
__attribute__((visibility("default")))
void finalize(); void finalize();
} }

View file

@ -219,6 +219,8 @@ namespace Layer {
} }
/// Symbol definition for Vulkan instance layer. /// Symbol definition for Vulkan instance layer.
__attribute__((visibility("default")))
extern "C" PFN_vkVoidFunction layer_vkGetInstanceProcAddr(VkInstance instance, const char* pName); extern "C" PFN_vkVoidFunction layer_vkGetInstanceProcAddr(VkInstance instance, const char* pName);
/// Symbol definition for Vulkan device layer. /// Symbol definition for Vulkan device layer.
__attribute__((visibility("default")))
extern "C" PFN_vkVoidFunction layer_vkGetDeviceProcAddr(VkDevice device, const char* pName); extern "C" PFN_vkVoidFunction layer_vkGetDeviceProcAddr(VkDevice device, const char* pName);

View file

@ -15,7 +15,9 @@
#include <thread> #include <thread>
namespace { namespace {
__attribute__((constructor)) void lsfgvk_init() { __attribute__((constructor))
__attribute__((visibility("default")))
void lsfgvk_init() {
std::cerr << std::unitbuf; std::cerr << std::unitbuf;
// read configuration // read configuration