Lines Matching +full:overlay +full:- +full:relative

1 # Cross toolchain configuration for using clang-cl on non-Windows hosts to
5 # cmake -G Ninja
6 # -DCMAKE_TOOLCHAIN_FILE=/path/to/this/file
7 # -DHOST_ARCH=[aarch64|arm64|armv7|arm|i686|x86|x86_64|x64]
8 # -DLLVM_NATIVE_TOOLCHAIN=/path/to/llvm/installation
9 # -DLLVM_WINSYSROOT=/path/to/win/sysroot
10 # -DMSVC_VER=vc tools version folder name
11 # -DWINSDK_VER=windows sdk version folder name
19 # copy of clang-cl, clang, clang++, and lld-link, as well as a lib directory
78 # Windows libraries and headers are not case-correct, this toolchain file sets
79 # up a VFS overlay for the SDK headers and case-correcting symlinks for the
80 # libraries when running on a case-sensitive filesystem.
84 # When configuring CMake with a toolchain file against a top-level CMakeLists.txt,
87 # invocations share a CMakeCache.txt with the top-level invocation, meaning they
88 # won't see the value of any arguments the user passed via -D. Since these are
89 # necessary to properly configure MSVC in both the top-level configuration as well as
90 # all feature-test invocations, we include them in CMAKE_TRY_COMPILE_PLATFORM_VARIABLES,
113 file(APPEND "${output_path}" "case-sensitive: false\n")
117 file(GLOB headers RELATIVE "${dir}" "${dir}/*.h")
122 file(APPEND "${output_path}" " - name: \"${dir}\"\n")
127 file(APPEND "${output_path}" " - name: \"${header}\"\n")
129 file(APPEND "${output_path}" " external-contents: \"${dir}/${header}\"\n")
135 execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${output_dir}")
136 file(GLOB libraries RELATIVE "${winsdk_um_lib_dir}" "${winsdk_um_lib_dir}/*")
141 -E create_symlink
153 -E create_symlink
161 execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${output_dir}")
162 file(GLOB libraries RELATIVE "${msvc_lib_dir}" "${msvc_lib_dir}/*.lib")
171 -E create_symlink
179 file(GLOB entries LIST_DIRECTORIES true RELATIVE "${the_dir}" "${the_dir}/[0-9.]*")
212 if(NOT EXISTS "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" OR
213 NOT EXISTS "${LLVM_NATIVE_TOOLCHAIN}/bin/lld-link")
216 "point to a valid directory containing bin/clang-cl and bin/lld-link "
258 set(CMAKE_C_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
259 set(CMAKE_CXX_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
260 set(CMAKE_LINKER "${LLVM_NATIVE_TOOLCHAIN}/bin/lld-link" CACHE FILEPATH "")
261 set(CMAKE_AR "${LLVM_NATIVE_TOOLCHAIN}/bin/llvm-lib" CACHE FILEPATH "")
262 set(CMAKE_ASM_MASM_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/llvm-ml" CACHE FILEPATH "")
264 # Even though we're cross-compiling, we need some native tools (e.g. llvm-tblgen), and those
265 # native tools have to be built before we can start doing the cross-build. LLVM supports
267 # when configuring the NATIVE portion of the cross-build. By default we construct this so
268 # that it points to the tools in the same location as the native clang-cl that we're using.
269 list(APPEND _CTF_NATIVE_DEFAULT "-DCMAKE_ASM_COMPILER=${LLVM_NATIVE_TOOLCHAIN}/bin/clang")
270 list(APPEND _CTF_NATIVE_DEFAULT "-DCMAKE_C_COMPILER=${LLVM_NATIVE_TOOLCHAIN}/bin/clang")
271 list(APPEND _CTF_NATIVE_DEFAULT "-DCMAKE_CXX_COMPILER=${LLVM_NATIVE_TOOLCHAIN}/bin/clang++")
278 -D_CRT_SECURE_NO_WARNINGS
279 --target=${TRIPLE_ARCH}-windows-msvc
280 -fms-compatibility-version=19.28
281 -vctoolsversion ${MSVC_VER}
282 -winsdkversion ${WINSDK_VER}
283 -winsysroot ${LLVM_WINSYSROOT})
286 # Ensure all sub-configures use the top-level VFS overlay instead of generating their own.
292 -Xclang -ivfsoverlay -Xclang "${winsdk_vfs_overlay_path}")
299 string(APPEND CMAKE_ASM_MASM_FLAGS_INIT " -m64")
306 -libpath:"${ATLMFC_LIB}/${WINSDK_ARCH}"
307 -libpath:"${MSVC_LIB}/${WINSDK_ARCH}"
308 -libpath:"${WINSDK_LIB}/ucrt/${WINSDK_ARCH}"
309 -libpath:"${WINSDK_LIB}/um/${WINSDK_ARCH}")
312 # Ensure all sub-configures use the top-level symlinks dir instead of generating their own.
318 -libpath:"${winsdk_lib_symlinks_dir}")
324 -libpath:"${msvc_lib_symlinks_dir}")
337 # extra case-correcting symlinks and what not. Instead, let projects explicitly
342 # Allow clang-cl to work with macOS paths.