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

8 lines
324 B
CMake
Raw Normal View History

2022-08-20 07:25:37 +03:00
# 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)