1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00
mold/create-symlink.cmake
2022-08-20 12:29:03 +08:00

8 lines
324 B
CMake

# Create a symbolic link with a relative path. GNU ln takes the --relative
# option to do that, but that's not portable, so we do it in CMake.
cmake_minimum_required(VERSION 3.14)
get_filename_component(DIR "${DEST}" DIRECTORY)
file(RELATIVE_PATH PATH "/${DIR}" "/${SOURCE}")
file(CREATE_LINK "${PATH}" "${DEST}" SYMBOLIC)