File tree Expand file tree Collapse file tree 6 files changed +22
-7
lines changed Expand file tree Collapse file tree 6 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ function(add_ur_target_compile_options name)
7070 )
7171 if (CMAKE_BUILD_TYPE STREQUAL "Release" )
7272 target_compile_definitions (${name} PRIVATE -D_FORTIFY_SOURCE=2)
73+ target_compile_options (${name} PRIVATE -fvisibility=hidden)
7374 endif ()
7475 if (UR_DEVELOPER_MODE)
7576 target_compile_options (${name} PRIVATE
Original file line number Diff line number Diff line change @@ -17,6 +17,6 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${TARGET_XPTI})
1717target_include_directories (${TARGET_NAME} PRIVATE ${xpti_SOURCE_DIR} /include )
1818
1919if (MSVC )
20- target_compile_definitions (${TARGET_NAME} PRIVATE
21- XPTI_STATIC_LIBRARY XPTI_CALLBACK_API_EXPORTS)
20+ target_compile_definitions (${TARGET_NAME} PRIVATE XPTI_STATIC_LIBRARY)
2221endif ()
22+ target_compile_definitions (${TARGET_NAME} PRIVATE XPTI_CALLBACK_API_EXPORTS)
Original file line number Diff line number Diff line change @@ -332,9 +332,17 @@ typedef enum ur_structure_type_t {
332332#if defined(_WIN32)
333333/// @brief Microsoft-specific dllexport storage-class attribute
334334#define UR_APIEXPORT __declspec(dllexport)
335+ #endif // defined(_WIN32)
336+ #endif // UR_APIEXPORT
337+
338+ ///////////////////////////////////////////////////////////////////////////////
339+ #ifndef UR_APIEXPORT
340+ #if __GNUC__ >= 4
341+ /// @brief GCC-specific dllexport storage-class attribute
342+ #define UR_APIEXPORT __attribute__((visibility("default")))
335343#else
336344#define UR_APIEXPORT
337- #endif // defined(_WIN32)
345+ #endif // __GNUC__ >= 4
338346#endif // UR_APIEXPORT
339347
340348///////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ desc: "Microsoft-specific dllexport storage-class attribute"
3939condition : " defined(_WIN32)"
4040name : $X_APIEXPORT
4141value : __declspec(dllexport)
42+ --- # --------------------------------------------------------------------------
43+ type : macro
44+ desc : " GCC-specific dllexport storage-class attribute"
45+ condition : " __GNUC__ >= 4"
46+ name : $X_APIEXPORT
47+ value : __attribute__ ((visibility ("default")))
4248altvalue : " "
4349--- # --------------------------------------------------------------------------
4450type : macro
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ target_link_libraries(test_collector PRIVATE ${TARGET_XPTI})
1515target_include_directories (test_collector PRIVATE ${xpti_SOURCE_DIR} /include )
1616
1717if (MSVC )
18- target_compile_definitions (test_collector PRIVATE
19- XPTI_STATIC_LIBRARY XPTI_CALLBACK_API_EXPORTS)
18+ target_compile_definitions (test_collector PRIVATE XPTI_STATIC_LIBRARY)
2019endif ()
20+ target_compile_definitions (test_collector PRIVATE XPTI_CALLBACK_API_EXPORTS)
2121
2222function (set_tracing_test_props target_name collector_name)
2323 set_tests_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${TARGET_XPTI} ${PROJECT_NAME}::com
1717target_include_directories (${TARGET_NAME} PRIVATE ${xpti_SOURCE_DIR} /include )
1818
1919if (MSVC )
20- target_compile_definitions (${TARGET_NAME} PRIVATE
21- XPTI_STATIC_LIBRARY XPTI_CALLBACK_API_EXPORTS)
20+ target_compile_definitions (${TARGET_NAME} PRIVATE XPTI_STATIC_LIBRARY)
2221endif ()
22+ target_compile_definitions (${TARGET_NAME} PRIVATE XPTI_CALLBACK_API_EXPORTS)
2323
2424set (UR_TRACE_CLI_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /urtrace)
2525
You can’t perform that action at this time.
0 commit comments