summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2018-07-06 17:19:32 -0700
committerBruce Forstall <Bruce_Forstall@msn.com>2018-08-01 22:37:04 -0700
commit22ba5204472650338e3d695074d1da90ee94ca87 (patch)
tree759b538e9b76ef09d64fb01c49c65fbb1750d6b2 /CMakeLists.txt
parentd7191b58cfc263479f57b45084097b773d8c235a (diff)
downloadcoreclr-22ba5204472650338e3d695074d1da90ee94ca87.tar.gz
coreclr-22ba5204472650338e3d695074d1da90ee94ca87.tar.bz2
coreclr-22ba5204472650338e3d695074d1da90ee94ca87.zip
Enable ARM64 builds using release product tools
Remove support for specifying the toolset directory for arm64, which was used to point to an internal toolset. Building for arm64 now works just like the other platforms, e.g. invoke `build arm64`. The requirements: . Visual Studio 2017 Update 4 or later, with ARM64 toolset installed . Windows SDK 10.0.17134.0 or later . CMake 3.10 or later
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt35
1 files changed, 18 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64a65e362d..a39d1aef36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,6 +66,24 @@ if (WIN32)
# Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly
# use ml[64].exe as the assembler.
enable_language(ASM)
+ elseif(CLR_CMAKE_HOST_ARCH STREQUAL arm64)
+
+ # Confirm that Windows SDK is present
+ if(NOT DEFINED CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION OR CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION STREQUAL "" )
+ message(FATAL_ERROR "Windows SDK is required for the ARM64 build.")
+ else()
+ message("Using Windows SDK version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+ endif()
+
+ # Explicitly specify the assembler to be used for Arm64 compile
+ file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm64\\armasm64.exe" CMAKE_ASM_COMPILER)
+
+ set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER})
+ message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")
+
+ # Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly
+ # use ml[64].exe as the assembler.
+ enable_language(ASM)
else()
enable_language(ASM_MASM)
endif()
@@ -76,16 +94,6 @@ if (WIN32)
message(FATAL_ERROR "MC not found")
endif()
- if (CLR_CMAKE_HOST_ARCH STREQUAL arm64)
- # CMAKE_CXX_COMPILER will default to the compiler installed with
- # Visual studio. Overwrite it to the compiler on the path.
- # TODO, remove when cmake generator supports Arm64 as a target.
- find_program(PATH_CXX_COMPILER cl)
- set(CMAKE_CXX_COMPILER ${PATH_CXX_COMPILER})
- message("Overwriting the CMAKE_CXX_COMPILER.")
- message(CMAKE_CXX_COMPILER found:${CMAKE_CXX_COMPILER})
- endif()
-
else (WIN32)
enable_language(ASM)
@@ -376,13 +384,6 @@ if (WIN32)
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG /OPT:REF /OPT:ICF ${NO_INCREMENTAL_LINKER_FLAGS}")
- # Temporary until cmake has VS generators for arm64
- if(CLR_CMAKE_PLATFORM_ARCH_ARM64)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:arm64")
- set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /machine:arm64")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:arm64")
- endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
-
# Force uCRT to be dynamically linked for Release build
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")