-
Notifications
You must be signed in to change notification settings - Fork 34
/
README
42 lines (29 loc) · 1.4 KB
/
README
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
Wclang is a tool which helps you to cross compile source code easily with clang on Linux/Unix for Windows.
Wclang is basically a wrapper for clang, which allows you to directly target Windows.
Wclang detects the target and headers automatically and adds them to the clang invocation command.
After the installation you will have "<mingw-triplet>-clang", "<mingw-triplet>-clang++" available as "compiler".
PREREQUISITES:
A C++11 compiler for compiling the wrapper (g++ 4.6+, clang)
clang
mingw-w64 with its headers and libs
cmake
INSTALLATION:
cmake -DCMAKE_INSTALL_PREFIX=_prefix_ .
make
make install
EXAMPLES:
i686-w64-mingw32-clang++ hello-world.cpp -o hello-world.exe && wine hello-world
CC=i686-w64-mingw32-clang ./configure --host=i686-w64-mingw32
x86_64-w64-mingw32-clang++ hello-world.cpp -o hello-world.exe && wine hello-world
CC=x86_64-w64-mingw32-clang ./configure --host=x86_64-w64-mingw32
LISTING AVAILABLE PARAMETERS:
i686-w64-clang -wc-help
LIMITATIONS:
C++ exceptions do not work with clang<3.7, and in 3.7 just for 64-bit, clang>=6.0 added support for 32-bit.
KNOWN TO WORK ON:
Linux: Ubuntu, Debian (Wheezy*), Mint, Arch, Fedora and openSUSE.
Other distributions may work as well, but have not been tested.
Windows: Cygwin.
* Wheezy: important: clang-3.0 coming with wheezy is too old
to compile the wrapper, so use g++ or get a newer clang
from e.g.: https://llvm.org/apt.