Skip to content

Commit 70c68d4

Browse files
WhiredPlanckBambooin
authored andcommitted
build(cmake): use cmake file command to create symlink
1 parent dc27449 commit 70c68d4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

app/src/main/jni/cmake/Rime.cmake

+14-9
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ set(RIME_PLUGINS
88

99
# symlink plugins
1010
foreach(plugin ${RIME_PLUGINS})
11-
execute_process(COMMAND ln -sv
12-
"${CMAKE_SOURCE_DIR}/${plugin}"
13-
"${CMAKE_SOURCE_DIR}/librime/plugins"
14-
)
11+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/librime/plugins/${plugin}")
12+
file(CREATE_LINK
13+
"${CMAKE_SOURCE_DIR}/${plugin}"
14+
"${CMAKE_SOURCE_DIR}/librime/plugins/${plugin}"
15+
COPY_ON_ERROR SYMBOLIC
16+
)
17+
endif()
1518
endforeach()
1619

1720
# librime-lua
18-
file(REMOVE "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty")
19-
execute_process(COMMAND ln -sv
20-
"${CMAKE_SOURCE_DIR}/librime-lua-deps"
21-
"${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty"
22-
)
21+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty")
22+
file(CREATE_LINK
23+
"${CMAKE_SOURCE_DIR}/librime-lua-deps"
24+
"${CMAKE_SOURCE_DIR}/librime/plugins/librime-lua/thirdparty"
25+
COPY_ON_ERROR SYMBOLIC
26+
)
27+
endif()
2328

2429
# librime-charcode
2530
option(BUILD_WITH_ICU "" OFF)

0 commit comments

Comments
 (0)