Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable using the Ninja generator instead of Visual Studio on Windows builds. #41897

Merged
merged 65 commits into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
cad3f29
Move DacTableGen out of the CMake build and into tools-local.
jkoritzinsky Jan 9, 2020
e921ecc
Merge branch 'master' of https://github.com/dotnet/runtime into dacta…
jkoritzinsky Mar 12, 2020
a69c346
Attempt: usenmakefiles means ninja.
jkoritzinsky Mar 17, 2020
d1b12b5
Make changes to Windows build to support non-VS generators like ninja.
jkoritzinsky Mar 18, 2020
df589ef
Use CMake 3.16 PCHs.
jkoritzinsky Mar 18, 2020
0524739
Remove explicit process count.
jkoritzinsky Mar 18, 2020
e99246f
Build and run DacTableGen via the .NET CLI we pull down for the build…
jkoritzinsky Aug 24, 2020
03140d8
Update configurecompiler.cmake to specify language (needed for Ninja).
jkoritzinsky Aug 24, 2020
9bdf0f1
Merge branch 'ninja-windows' of github.com:jkoritzinsky/runtime into …
jkoritzinsky Aug 24, 2020
417b07a
Get Ninja build working again.
jkoritzinsky Aug 24, 2020
db7454a
Merge branch 'master' of https://github.com/dotnet/runtime into ninja…
jkoritzinsky Aug 24, 2020
b70eeca
Pass configuration to cmake configure step for Ninja build.
jkoritzinsky Aug 31, 2020
36cc91e
Rename flag
jkoritzinsky Aug 31, 2020
fe484c9
Fix configure step for cross-arch native build
jkoritzinsky Aug 31, 2020
cba81df
Support building via Ninja for coreclr via an MSBuild property
jkoritzinsky Aug 31, 2020
c20b356
Implement support for opening the CoreCLR solution in VS via the -vs …
jkoritzinsky Sep 1, 2020
86f5f90
Fix setting generator to Ninja.
jkoritzinsky Sep 1, 2020
a2478cc
Merge libraries gen-buildsys-win.bat with runtime gen-buildsys.cmd to…
jkoritzinsky Sep 3, 2020
ca84dd2
Enable building libraries native build with ninja.
jkoritzinsky Sep 3, 2020
3b17211
Centralize setting CMAKE_SYSTEM_VERSION for windows builds.
jkoritzinsky Sep 3, 2020
8422b09
Update host build to use shared gen-buildsys.cmd
jkoritzinsky Sep 3, 2020
885974e
Fix multi-config generator detection.
jkoritzinsky Sep 4, 2020
a8feb74
Exit with success when we build successfully.
jkoritzinsky Sep 4, 2020
e7b9280
Enable and fix up Ninja build for hosts.
jkoritzinsky Sep 4, 2020
6bcaec4
Only link delayimp.lib on Windows
jkoritzinsky Sep 4, 2020
cb1f6a1
Remove "overriding /W3 with /W1" warning in Ninja build of hosts by t…
jkoritzinsky Sep 4, 2020
03c4cc9
Reduce command line override warnings by adopting the MSVC_RUNTIME_LI…
jkoritzinsky Sep 4, 2020
0378122
Use the delayed expansion syntax to correctly pass in the config to c…
jkoritzinsky Sep 8, 2020
195fa3e
Move all usages of MSVC runtime library selection to the CMake abstra…
jkoritzinsky Sep 8, 2020
7c7c168
Condition the rest of the compiler options correctly so they don't sh…
jkoritzinsky Sep 8, 2020
5dc02c0
Correctly build DIALib and DacTableGen as AnyCPU
jkoritzinsky Sep 9, 2020
86019b9
Fix WRITE_BARRIER_CHECK define
jkoritzinsky Sep 9, 2020
823cef9
Fix passing arch for MSBuild build.
jkoritzinsky Sep 9, 2020
3e60c98
Configure ASM compiler command line format in configurecompiler.cmake…
jkoritzinsky Sep 9, 2020
4d81fe8
Cleanup after fixing ARM/ARM64 support.
jkoritzinsky Sep 9, 2020
8286fba
Rename variable
jkoritzinsky Sep 9, 2020
0d9205a
Merge branch 'master' into ninja-windows
jkoritzinsky Sep 9, 2020
82f0491
Condition PCH's for C++-only as needed to fix using them on non-Windo…
jkoritzinsky Sep 10, 2020
6541aeb
Fix CoreCLR native test build on windows to point to new gen-buildsys…
jkoritzinsky Sep 10, 2020
ca101e9
Add missing compilation options in Ninja build that are implicitly de…
jkoritzinsky Sep 14, 2020
78fd252
Merge branch 'master' into ninja-windows
jkoritzinsky Sep 29, 2020
18acb6f
Disable analyzers for DacTableGen. Remove /MAP linker flag (that's fo…
jkoritzinsky Sep 30, 2020
d38ae03
Upgrade to CMake 3.16.4
jkoritzinsky Oct 7, 2020
5051f71
Merge branch 'master' of github.com:dotnet/runtime into ninja-windows
jkoritzinsky Oct 19, 2020
43e8a7b
Don't warn on unused variables in CMake (these usually vary on platfo…
jkoritzinsky Oct 19, 2020
a34284e
Manually compile ARM and ARM64 asm files when using the VS generator …
jkoritzinsky Oct 20, 2020
ccd66f5
Merge branch 'master' of github.com:dotnet/runtime into ninja-windows
jkoritzinsky Oct 20, 2020
992817d
Enable CMake policy in test build to use CMAKE_MSVC_RUNTIME_LIBRARY v…
jkoritzinsky Oct 20, 2020
7db1ecb
Merge branch 'ninja-windows' of github.com:jkoritzinsky/runtime; bran…
jkoritzinsky Oct 20, 2020
aa79e4f
Update initially disabled warnings in host.
jkoritzinsky Oct 21, 2020
327b002
Add -ninja arg to root scripts to enable using Ninja.
jkoritzinsky Oct 21, 2020
bc701d1
Enable using Ninja in CoreCLR CI.
jkoritzinsky Oct 21, 2020
d95091e
Merge branch 'master' of github.com:dotnet/runtime into ninja-windows
jkoritzinsky Oct 21, 2020
334293c
Try to fix passing the -ninja arg in yaml.
jkoritzinsky Oct 21, 2020
c1b3676
Add ninja to the Windows invocation
jkoritzinsky Oct 21, 2020
2945f4d
Merge branch 'master' of github.com:dotnet/runtime into ninja-windows
jkoritzinsky Oct 21, 2020
cfc26f5
Fix 2-phase cross targeting to do one phase at a time and initialize …
jkoritzinsky Oct 21, 2020
343690e
Restore old /Ox optimization setting for Release.
jkoritzinsky Oct 22, 2020
9af32b3
Fix typos, don't pass exception flags to C files.
jkoritzinsky Oct 22, 2020
61e4c81
Remove unneeded pragma.
jkoritzinsky Oct 22, 2020
a437115
Merge branch 'master' of github.com:dotnet/runtime into ninja-windows
jkoritzinsky Oct 27, 2020
83939c6
Fix .pgd file installation.
jkoritzinsky Oct 27, 2020
f95c8f6
Add mention of the `-ninja` flag in the Building CoreCLR documentation.
jkoritzinsky Oct 27, 2020
ff80bab
Mention installation locations for Ninja and warn while building if C…
jkoritzinsky Oct 28, 2020
4db3105
Update docs/workflow/requirements/windows-requirements.md
jkoritzinsky Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/workflow/requirements/freebsd-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ Install the following packages:
- lttng-ust
- krb5
- openssl (optional)
- ninja (optional, enables building native code with ninja instead of make)

The lines to install all the packages above using package manager.

```sh
sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake autoconf automake openssl
sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake autoconf automake openssl ninja
```

Additionally, working dotnet cli with SDK is needed. On other platforms this would be downloaded automatically during build but it is not currently available for FreeBSD.
Expand Down
3 changes: 2 additions & 1 deletion docs/workflow/requirements/linux-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Install the following packages for the toolchain:
- libkrb5-dev
- libnuma-dev (optional, enables numa support)
- zlib1g-dev
- ninja (optional, enables building native code with ninja instead of make)

The following dependencies are needed if Mono Runtime is enabled (default behavior):

Expand All @@ -61,7 +62,7 @@ The following dependencies are needed if Mono Runtime is enabled (default behavi
sudo apt-get install -y cmake llvm-9 clang-9 autoconf automake \
libtool build-essential python curl git lldb-6.0 liblldb-6.0-dev \
libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev \
libssl-dev libnuma-dev libkrb5-dev zlib1g-dev
libssl-dev libnuma-dev libkrb5-dev zlib1g-dev ninja
```

You now have all the required components.
3 changes: 2 additions & 1 deletion docs/workflow/requirements/macos-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ Install the following packages:
- openssl 1.1
- pkg-config
- python3
- ninja (optional, enables building native code with ninja instead of make)

You can install all the packages above using Homebrew by running this command in the repository root:
You can install all the required packages above using Homebrew by running this command in the repository root:

```
brew bundle --no-lock --file eng/Brewfile
Expand Down
8 changes: 7 additions & 1 deletion docs/workflow/requirements/windows-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ The dotnet/runtime repository requires at least Visual Studio 2019 16.6.
- Add its location (e.g. C:\Program Files (x86)\CMake\bin) to the PATH environment variable.
The installation script has a check box to do this, but you can do it yourself after the fact following the instructions at [Adding to the Default PATH variable](#adding-to-the-default-path-variable).

The dotnet/runtime repository requires at least CMake 3.15.5.
The dotnet/runtime repository recommends using CMake 3.16.0 or newer, but works with CMake 3.15.5.

## Ninja (optional)

- Install Ninja in one of the two following ways
- [Download the executable](https://github.com/ninja-build/ninja/releases) and add it's location to [the Default PATH variable](#adding-to-the-default-path-variable).
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
- [Install via a package manager](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages), which should automatically add it to the PATH environment variable.

## Python

Expand Down
5 changes: 4 additions & 1 deletion eng/native/set-cmake-path.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ try {
$version = [Version]$(& $cmakePath --version | Select-String -Pattern '\d+\.\d+\.\d+' | %{$_.Matches.Value})

if ($version -lt [Version]"3.14.0") {
Throw "This repository requires CMake 3.14. The newest version of CMake installed is $version. Please install CMake 3.14 or newer from https://cmake.org/download/ and ensure it is on your path."
Throw "This repository requires CMake 3.14 and recommends CMake 3.16. The newest version of CMake installed is $version. Please install CMake 3.16 or newer from https://cmake.org/download/ and ensure it is on your path."
}
elseif ($version -lt [Version]"3.16.0") {
[System.Console]::Error.WriteLine("CMake 3.16 or newer is recommended for building this repository. The newest version of CMake installed is $version. Please install CMake 3.16 or newer from https://cmake.org/download/ and ensure it is on your path.")
}

[System.Console]::WriteLine("set CMakePath=" + $cmakePath)
Expand Down