Skip to content

Commit aaeee40

Browse files
author
elsa
committed
add tls flags to customlabels dep
1 parent f9f5659 commit aaeee40

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmake/deps/customlabels.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,27 @@ FetchContent_Declare(customlabels
55
GIT_TAG elsa/add-process-storage
66
)
77

8+
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
9+
set(TLS_DIALECT desc)
10+
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
11+
set(TLS_DIALECT gnu2)
12+
else()
13+
message(FATAL_ERROR "Only aarch64 and x86-64 are supported (found: ${CMAKE_SYSTEM_PROCESSOR})")
14+
endif()
15+
816
FetchContent_MakeAvailable(customlabels)
917

1018
add_library(customlabels SHARED
1119
${customlabels_SOURCE_DIR}/src/customlabels.c
1220
)
1321

22+
target_compile_options(customlabels PRIVATE
23+
-g
24+
-fPIC
25+
-ftls-model=global-dynamic
26+
-mtls-dialect=${TLS_DIALECT}
27+
)
28+
1429
target_include_directories(customlabels
1530
PUBLIC
1631
${customlabels_SOURCE_DIR}/src

0 commit comments

Comments
 (0)