Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jekoritz@microsoft.com>2020-11-02 18:50:01 +0300
committerGitHub <noreply@github.com>2020-11-02 18:50:01 +0300
commit8c6a049cdb4bcd958cc3487775174bdd32e5fb64 (patch)
treead0c9c276041a60f5b191459c70f19e9f159392c /src/coreclr/CMakeLists.txt
parent33056a9000f8067687bac54363b4215f16ac09a6 (diff)
Enable using the Ninja generator instead of Visual Studio on Windows builds. (#41897)
* Move DacTableGen out of the CMake build and into tools-local. * Attempt: usenmakefiles means ninja. * Make changes to Windows build to support non-VS generators like ninja. * Use CMake 3.16 PCHs. * Remove explicit process count. * Build and run DacTableGen via the .NET CLI we pull down for the build instead of via CMake. * Update configurecompiler.cmake to specify language (needed for Ninja). Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Get Ninja build working again. * Pass configuration to cmake configure step for Ninja build. * Rename flag * Fix configure step for cross-arch native build Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Support building via Ninja for coreclr via an MSBuild property Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Implement support for opening the CoreCLR solution in VS via the -vs flag. * Fix setting generator to Ninja. * Merge libraries gen-buildsys-win.bat with runtime gen-buildsys.cmd to share windows cmake configure infra. * Enable building libraries native build with ninja. * Centralize setting CMAKE_SYSTEM_VERSION for windows builds. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Update host build to use shared gen-buildsys.cmd * Fix multi-config generator detection. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Exit with success when we build successfully. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Enable and fix up Ninja build for hosts. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Only link delayimp.lib on Windows Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Remove "overriding /W3 with /W1" warning in Ninja build of hosts by turning on /W3 and disabling any new warnings we hit. * Reduce command line override warnings by adopting the MSVC_RUNTIME_LIBRARY abstraction feature in CMake 3.14+ (below the minimum requirement on Windows). * Use the delayed expansion syntax to correctly pass in the config to cmake. * Move all usages of MSVC runtime library selection to the CMake abstraction to reduce console spew about overridden flags. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Condition the rest of the compiler options correctly so they don't show up as invalid parameter warnings for assembly builds. * Correctly build DIALib and DacTableGen as AnyCPU * Fix WRITE_BARRIER_CHECK define Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Fix passing arch for MSBuild build. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Configure ASM compiler command line format in configurecompiler.cmake and use CMake's assembly compilation step to build ASM files for ARM/ARM64 instead of manually building them and adding the generated files as additional sources. * Cleanup after fixing ARM/ARM64 support. * Rename variable * Condition PCH's for C++-only as needed to fix using them on non-Windows (where we compile C as C instead of as C++). * Fix CoreCLR native test build on windows to point to new gen-buildsys location. * Add missing compilation options in Ninja build that are implicitly defined in the MSBuild build. * Disable analyzers for DacTableGen. Remove /MAP linker flag (that's for local testing). * Upgrade to CMake 3.16.4 * Don't warn on unused variables in CMake (these usually vary on platform/config) Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Manually compile ARM and ARM64 asm files when using the VS generator since it doesn't support emitting MARMASM item types in projects (and as a result cannot compile ARM or ARM64 asm without assistance). * Enable CMake policy in test build to use CMAKE_MSVC_RUNTIME_LIBRARY variable. * Update initially disabled warnings in host. * Add -ninja arg to root scripts to enable using Ninja. * Enable using Ninja in CoreCLR CI. * Try to fix passing the -ninja arg in yaml. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Add ninja to the Windows invocation * Fix 2-phase cross targeting to do one phase at a time and initialize the VC++ environment for the correct build tools each time instead of interleaving them and relying on Visual Studio to handle the differing targets. * Restore old /Ox optimization setting for Release. * Fix typos, don't pass exception flags to C files. * Remove unneeded pragma. * Fix .pgd file installation. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Add mention of the `-ninja` flag in the Building CoreCLR documentation. Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com> * Mention installation locations for Ninja and warn while building if CMake is older than 3.16.0. * Update docs/workflow/requirements/windows-requirements.md
Diffstat (limited to 'src/coreclr/CMakeLists.txt')
-rw-r--r--src/coreclr/CMakeLists.txt13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt
index e5dbed52b56..e6495e02508 100644
--- a/src/coreclr/CMakeLists.txt
+++ b/src/coreclr/CMakeLists.txt
@@ -1,19 +1,18 @@
cmake_minimum_required(VERSION 3.6.2)
cmake_policy(SET CMP0042 NEW)
+if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15)
+ cmake_policy(SET CMP0091 NEW)
+endif()
# Set the project name
project(CoreCLR)
include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake)
-if (CLR_CMAKE_HOST_WIN32)
- message(STATUS "VS_PLATFORM_TOOLSET is ${CMAKE_VS_PLATFORM_TOOLSET}")
- message(STATUS "VS_PLATFORM_NAME is ${CMAKE_VS_PLATFORM_NAME}")
-endif (CLR_CMAKE_HOST_WIN32)
-
if(MSVC)
- add_compile_options(/EHa) # enable C++ EH (w/ SEH exceptions)
+ string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/EHa>) # enable C++ EH (w/ SEH exceptions)
set(CMAKE_CXX_STANDARD_LIBRARIES "") # do not link against standard win32 libs i.e. kernel32, uuid, user32, etc.
endif (MSVC)
@@ -96,7 +95,7 @@ add_subdirectory(src/tools/aot/jitinterface)
# All of the compiler options are specified in file compileoptions.cmake
# Do not add any new options here. They should be added in compileoptions.cmake
if(CLR_CMAKE_HOST_WIN32)
- add_compile_options(/Zl) # omit default library name in .OBJ
+ add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/Zl>) # omit default library name in .OBJ
endif(CLR_CMAKE_HOST_WIN32)
#--------------------------------