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)
70
70
)
71
71
if (CMAKE_BUILD_TYPE STREQUAL "Release" )
72
72
target_compile_definitions (${name} PRIVATE -D_FORTIFY_SOURCE=2 )
73
+ target_compile_options (${name} PRIVATE -fvisibility=hidden )
73
74
endif ()
74
75
if (UR_DEVELOPER_MODE )
75
76
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})
17
17
target_include_directories (${TARGET_NAME} PRIVATE ${xpti_SOURCE_DIR} /include )
18
18
19
19
if (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 )
22
21
endif ()
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 {
332
332
#if defined(_WIN32)
333
333
/// @brief Microsoft-specific dllexport storage-class attribute
334
334
#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")))
335
343
#else
336
344
#define UR_APIEXPORT
337
- #endif // defined(_WIN32)
345
+ #endif // __GNUC__ >= 4
338
346
#endif // UR_APIEXPORT
339
347
340
348
///////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ desc: "Microsoft-specific dllexport storage-class attribute"
39
39
condition : " defined(_WIN32)"
40
40
name : $X_APIEXPORT
41
41
value : __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")))
42
48
altvalue : " "
43
49
--- # --------------------------------------------------------------------------
44
50
type : macro
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ target_link_libraries(test_collector PRIVATE ${TARGET_XPTI})
15
15
target_include_directories (test_collector PRIVATE ${xpti_SOURCE_DIR} /include )
16
16
17
17
if (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 )
20
19
endif ()
20
+ target_compile_definitions (test_collector PRIVATE XPTI_CALLBACK_API_EXPORTS )
21
21
22
22
function (set_tracing_test_props target_name collector_name )
23
23
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
17
17
target_include_directories (${TARGET_NAME} PRIVATE ${xpti_SOURCE_DIR} /include )
18
18
19
19
if (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 )
22
21
endif ()
22
+ target_compile_definitions (${TARGET_NAME} PRIVATE XPTI_CALLBACK_API_EXPORTS )
23
23
24
24
set (UR_TRACE_CLI_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /urtrace )
25
25
You can’t perform that action at this time.
0 commit comments