File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,27 @@ add_library(customlabels SHARED
11
11
${customlabels_SOURCE_DIR} /src/customlabels.c
12
12
)
13
13
14
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
15
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" )
16
+ set (TLS_DIALECT desc )
17
+ elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" )
18
+ set (TLS_DIALECT gnu2 )
19
+ else ()
20
+ message (FATAL_ERROR "Only aarch64 and x86-64 are supported (found: ${CMAKE_SYSTEM_PROCESSOR} )" )
21
+ endif ()
22
+
23
+ include (CheckCompilerFlag )
24
+ check_compiler_flag (CXX "-ftls-dialect=${TLS_DIALECT} " TLS_DIALECT_OK )
25
+ if (TLS_DIALECT_OK )
26
+ target_compile_options (customlabels PRIVATE
27
+ -g
28
+ -fPIC
29
+ -ftls-model=global-dynamic
30
+ -mtls-dialect=${TLS_DIALECT}
31
+ )
32
+ endif ()
33
+ endif ()
34
+
14
35
target_include_directories (customlabels
15
36
PUBLIC
16
37
${customlabels_SOURCE_DIR} /src
You can’t perform that action at this time.
0 commit comments