Skip to content

Commit 5450a6a

Browse files
authored
Use target_link_options instead of set_target_properties for linking (#524)
1 parent ca6055f commit 5450a6a

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

lib/Interpreter/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,13 @@ if(EMSCRIPTEN)
129129
#FIXME: A patch is needed to llvm to remove -Wl,-z,defs since it is now recognised on emscripten. What needs to be removed is here
130130
# https://github.com/llvm/llvm-project/blob/128e2e446e90c3b1827cfc7d4d19e3c0976beff3/llvm/cmake/modules/HandleLLVMOptions.cmake#L318 . The PR to do try to do this is here
131131
# https://github.com/llvm/llvm-project/pull/123396
132-
set_target_properties(clangCppInterOp PROPERTIES
133-
NO_SONAME 1
134-
LINK_FLAGS "-s WASM_BIGINT -s SIDE_MODULE=1 ${SYMBOLS_LIST}"
132+
set_target_properties(clangCppInterOp
133+
PROPERTIES NO_SONAME 1
134+
)
135+
target_link_options(clangCppInterOp
136+
PRIVATE "SHELL: -s WASM_BIGINT"
137+
PRIVATE "SHELL: -s SIDE_MODULE=1"
138+
PRIVATE "SHELL: ${SYMBOLS_LIST}"
135139
)
136140
if (CPPINTEROP_ENABLE_TESTING)
137141
# When compiling Emscripten tests the shared library it links to is expected to be in the same folder as the compiled Javascript

unittests/CppInterOp/TestSharedLib/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ set_output_directory(TestSharedLib
1111

1212

1313
if (EMSCRIPTEN)
14-
set_target_properties(TestSharedLib PROPERTIES
15-
NO_SONAME 1
16-
LINK_FLAGS "-s WASM_BIGINT -s SIDE_MODULE=1"
14+
set_target_properties(TestSharedLib
15+
PROPERTIES NO_SONAME 1
16+
)
17+
target_link_options(TestSharedLib
18+
PRIVATE "SHELL: -s WASM_BIGINT"
19+
PRIVATE "SHELL: -s SIDE_MODULE=1"
1720
)
1821
endif()
1922

0 commit comments

Comments
 (0)