forked from gnustep/libobjc2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.windows
36 lines (28 loc) · 1.33 KB
/
README.windows
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
Building on Windows
===================
The runtime can build on Windows with either Ninja or msbuild.
Ninja is strongly preferred, but if you wish to debug with Visual Studio then you will need to use msbuild.
To compile with msbuild, you must install the (LLVM toolchain)[https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.llvm-toolchain] and then, from a Visual Studio command prompt:
```
> mkdir build
> cd build
> cmake -G "Visual Studio 15 2017 Win64" -T LLVM -DASSEMBLER=path/to/clang-cl.exe ..
> set CCC_OVERRIDE_OPTIONS=x-TC x-TP x/TC x/TP
> cmake --build .
```
This will give you a solution file that you can open in Visual Studio.
If you don't wish to use the Visual Studio IDE, then you can compile with Ninja:
```
> mkdir build
> cd build
> cmake -G Ninja -DCMAKE_C_COMPILER=path/to/clang-cl.exe -DCMAKE_CXX_COMPILER=path/to/clang-cl.exe ..
> set CCC_OVERRIDE_OPTIONS=x-TC x-TP x/TC x/TP
> ninja
```
Unfortunately, CMake insists on adding flags so that force cl.exe to treat the input as C or C++.
The `CCC_OVERRIDE_OPTIONS` environment variable strips these flags off.
Debugging
---------
The tests will all fail on Windows because they will not find objc.dll.
To fix this, copy objc.dll into the `Tests` build directory.
Alternatively, from within Visual Studio, set the working directory for the test to the `Debug` directory.