llvm.org GIT mirror llvm / 24abcf4
[cmake] Also create lowercase extension WinSDK symlinks Some projects rely on using libraries from the Windows SDK with their original casing, just with a lowercase extension. E.g. the WinSock2 lib is named WS2_32.Lib in the Windows SDK, and we would previously only create a ws2_32.lib symlink for it (i.e. all lowercase). Also create a WS2_32.lib symlink (i.e. original casing with lowercase extension) to cover users of this casing. As a drive-by fix, only create these symlinks when they differ from the original name to reduce the amount of noise in the library symlinks directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343832 91177308-0d34-0410-b5e6-96231b3b80d8 Shoaib Meenai 1 year, 19 days ago
1 changed file(s) with 19 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
135135 execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${output_dir}")
136136 file(GLOB libraries RELATIVE "${winsdk_um_lib_dir}" "${winsdk_um_lib_dir}/*")
137137 foreach(library ${libraries})
138 string(TOLOWER "${library}" symlink_name)
139 execute_process(COMMAND "${CMAKE_COMMAND}"
140 -E create_symlink
141 "${winsdk_um_lib_dir}/${library}"
142 "${output_dir}/${symlink_name}")
138 string(TOLOWER "${library}" all_lowercase_symlink_name)
139 if(NOT library STREQUAL all_lowercase_symlink_name)
140 execute_process(COMMAND "${CMAKE_COMMAND}"
141 -E create_symlink
142 "${winsdk_um_lib_dir}/${library}"
143 "${output_dir}/${all_lowercase_symlink_name}")
144 endif()
145
146 get_filename_component(name_we "${library}" NAME_WE)
147 get_filename_component(ext "${library}" EXT)
148 string(TOLOWER "${ext}" lowercase_ext)
149 set(lowercase_ext_symlink_name "${name_we}${lowercase_ext}")
150 if(NOT library STREQUAL lowercase_ext_symlink_name AND
151 NOT all_lowercase_symlink_name STREQUAL lowercase_ext_symlink_name)
152 execute_process(COMMAND "${CMAKE_COMMAND}"
153 -E create_symlink
154 "${winsdk_um_lib_dir}/${library}"
155 "${output_dir}/${lowercase_ext_symlink_name}")
156 endif()
143157 endforeach()
144158 endfunction()
145159