File: windows-support.txt

package info (click to toggle)
libfyaml 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,416 kB
  • sloc: ansic: 64,719; asm: 8,692; sh: 1,658; makefile: 637; python: 23
file content (46 lines) | stat: -rw-r--r-- 1,816 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
You need to download msvc and the winsdk
I used git@github.com:mstorsjo/msvc-wine.git

Assume that you've installed at "${MSVC}"

== Build with MSVC using wine

$ mkdir build-msvc
$ cd build-msvc
$ export PATH="${MSVC}/bin/x64:/usr/bin:$PATH"
$ CC=cl CXX=cl cmake -S .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_MAKE_PROGRAM=/usr/bin/make

=== Build with clang-cl without wine

$ sudo apt-get install clang-cl	llvm # I used clang-cl-18
$ mkdir build-clang-cl
$ cd build-clang-cl
$ export INCLUDE="${MSVC}/vc/tools/msvc/14.44.35207/include;${MSVC}/kits/10/include/10.0.26100.0/shared;${MSVC}/kits/10/include/10.0.26100.0/ucrt;${MSVC}/kits/10/include/10.0.26100.0/um"
$ export LIB="${MSVC}/vc/tools/msvc/14.44.35207/lib/x64;${MSVC}/kits/10/lib/10.0.26100.0/ucrt/x64;${MSVC}/kits/10/lib/10.0.26100.0/um/x64"
$ cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_SYSTEM_NAME=Windows \
  -DCMAKE_C_COMPILER=clang-cl-18 \
  -DCMAKE_CXX_COMPILER=clang-cl-18 \
  -DCMAKE_LINKER=lld-link-18 \
  -DCMAKE_MT=llvm-mt-18 \
  -DCMAKE_RC_COMPILER=llvm-rc-18

=== Build with native clang cross compiling for windows
$ export INCLUDE="${MSVC}/vc/tools/msvc/14.44.35207/include;${MSVC}/kits/10/include/10.0.26100.0/shared;${MSVC}/kits/10/include/10.0.26100.0/ucrt;${MSVC}/kits/10/include/10.0.26100.0/um"
$ export LIB="${MSVC}/vc/tools/msvc/14.44.35207/lib/x64;${MSVC}/kits/10/lib/10.0.26100.0/ucrt/x64;${MSVC}/kits/10/lib/10.0.26100.0/um/x64"
$ cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/clang-windows-toolchain.cmake


--- new method

=== MSVC using wine
$ cmake -DMSVC_WINE_DIR="${MSVC}" -DMSVC_WINE_COMPILER=cl ..

=== clang-cl
$ cmake -DMSVC_WINE_DIR="${MSVC}" -DMSVC_WINE_COMPILER=clang-cl ..

=== clang cross
$ cmake -DMSVC_WINE_DIR="${MSVC}" -DMSVC_WINE_COMPILER=clang ..