You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update docs to reflect the new automation script changes (#801)
The automation scripts used to build and test the Checked C compiler have now been moved to their own repo. For Windows builds we have deprecated msbuild and have now switched to using CMake with Ninja. We have accordingly updated the setup, build and testing docs here.
Note: The automation scripts used to build and test the Checked C compiler have
4
+
now been moved to their own [repo](https://github.com/microsoft/checkedc-automation).
5
+
For Windows builds we have deprecated msbuild and have now switched to using
6
+
CMake with Ninja.
7
+
3
8
## Setting up your machine
4
9
5
10
See the clang [Getting started guide](http://clang.llvm.org/get_started.html) for information
6
-
on how to set up your machine. For Linux, you should install CMake 3.8 or later.
7
-
If you will be developing on Windows, you should install CMake 3.14 or later on your machine.
11
+
on how to set up your machine.
8
12
9
-
### Developing on Windows
13
+
We now use CMake and Ninja for Clang builds on both Windows and Linux. For
14
+
Linux, install CMake 3.8 or later. For Windows, CMake is bundled as
15
+
part of your Visual Studio install.
10
16
11
-
We are doing the development work for Checked C on Windows. We have a few recommendations for developing
12
-
clang on Windows using Visual Studio.
17
+
### Developing on Windows
13
18
14
19
We recommend that you use a 64-bit version of Windows. We have found that the 32-bit hosted
15
20
Visual Studio linker tends to run out of memory when linking clang or clang tools. You will
16
21
want to use the 64-bit hosted Visual Studio toolset instead, which will require a 64-bit version
17
22
of Windows too.
18
23
19
-
You will need to install the following before building:
20
-
21
-
- Visual Studio 2017 or later, CMake (version 3.14 or later), Python (version 2.7), and versions of UNIX command
22
-
line tools. We recommend using Visual Studio 2019.
23
-
- For UNIX command-line tools, we recommend installing them via Cygwin because these are well-maintained.
24
-
Go to [http://www.cygwin.com](http://www.cygwin.com) and download the installer (put it in a known place).
25
-
Then run it and use the GUI to install the coreutils and diffutils packages. Add the bin subdirectory to your system path.
26
-
27
-
If you plan to use Visual Studio to build projects, you must limit the amount
28
-
of parallelism that will be used during builds. By default, the Visual Studio solution
29
-
for clang has [too much parallelism](https:/github.com/Microsoft/checkedc-clang/issues/268).
30
-
The parallelism will cause your build to use too much physical memory and cause your machine
31
-
to start paging. This will make your machine unresponsive and slow down your build too.
32
-
See the Wiki page on [Parallel builds of clang on Windows](https://github.com/Microsoft/checkedc-clang/wiki/Parallel-builds-of-clang-on-Windows/)
33
-
for more details.
34
-
35
-
in VS 2017 or VS 2019, go to _Debug->Options->Projects and Solutions->VC++ Project Settings_ and set
36
-
the `Maximum Number of concurrent C++ compilations` to 3, if your development machine has
37
-
1 GByte of memory or more per core. If not, see the
- Visual Studio 2017 or later, Python (version 2.7), and versions of UNIX
27
+
command-line tools. We recommend using Visual Studio 2019.
28
+
- For VS2019, go to Tools -> Get Tools and Features (this opens the VS installer)
29
+
- Go to Individual Components
30
+
- Scroll to the “SDKs, libraries, and frameworks” section (near the bottom of the list)
31
+
- Check “C++ ATL for latest v142 build tools (x86 and x64)”
32
+
- Install
33
+
34
+
- For UNIX command-line tools, install them via [GnuWin32](https://sourceforge.net/projects/getgnuwin32/postdownload)
35
+
- In cmd prompt, cd to the download dir and run:
36
+
- download.bat
37
+
- install.bat C:\GnuWin32
38
+
- set PATH=C:\GnuWin32\bin;%PATH%
39
+
40
+
- If Ninja is not already available on your machine, you can download it from [here](https://github.com/ninja-build/ninja/releases).
41
+
Remember to set path to the ninja executable.
42
+
43
+
In order to limit the amount of build parallelism with Visual Studio:
44
+
- Debug->Options->Projects and Solutions->VC++ Project Settings
45
+
- Set `Maximum Number of concurrent C++ compilations` to 3, if your development machine has
46
+
1 GByte of memory or more per core. If not, see the [Wiki page](https://github.com/Microsoft/checkedc-clang/wiki/Parallel-builds-of-clang-on-Windows/)
39
47
to figure out what number to use.
40
48
By default, 0 causes it to be the number of available CPU cores on your machine, which is too much.
41
-
You should also to go to _Debug->Options->Projects and Solutions->Build and Run_ and
49
+
You should also to go to Debug->Options->Projects and Solutions->Build and Run and
42
50
set the maximum number of parallel project builds to be 3/4 of the actual number of CPU cores on
43
51
your machine.
44
52
53
+
A note about line endings:
45
54
LLVM/Clang have some tests that depend on using UNIX line ending conventions
46
55
(line feeds only). This means that the sources you will be working with
47
56
need to end with line feeds. Visual Studio preserves line endings for files, so
0 commit comments