File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ target_link_libraries(${lib_name}
29
29
core
30
30
)
31
31
32
+ target_compile_definitions (${lib_name} PUBLIC "USE_CMAKE_GENERATED_EXPORT_HEADER" )
33
+
32
34
include ("GenerateExportHeader" )
33
35
generate_export_header (${lib_name}
34
36
EXPORT_MACRO_NAME TORCHTRT_API
Original file line number Diff line number Diff line change 7
7
*/
8
8
#pragma once
9
9
10
+ #if defined(USE_CMAKE_GENERATED_EXPORT_HEADER)
11
+ #include < torch_tensorrt_export.h>
12
+ #else
10
13
#if defined(__GNUC__)
11
14
#define TORCHTRT_API __attribute__ ((__visibility__(" default" )))
12
15
#define TORCHTRT_HIDDEN __attribute__ ((__visibility__(" hidden" )))
13
16
#else
14
- // This can be used also if defined(__GNUC__) but is generated by CMake
15
- // and will be missing when compiling with Bazel
16
- #include < torch_tensorrt_export.h>
17
+ #define TORCHTRT_API
18
+ #define TORCHTRT_HIDDEN
17
19
#endif // defined(__GNUC__)
20
+ #endif // defined(USE_CMAKE_GENERATED_EXPORT_HEADER)
18
21
19
22
// Does this need to be gaurded or something?
20
23
#define XSTR (x ) #x
You can’t perform that action at this time.
0 commit comments