Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Clean up our CMake scripts using features introduced between 3.0 and 3.14 #26980

Merged
merged 37 commits into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2c05a7e
Try to remove the CLR_CMAKE_COMPILER weirdness.
jkoritzinsky Sep 20, 2019
e4083be
Cleanup phase 1.
jkoritzinsky Sep 20, 2019
77e170f
Drive dac and crossgen-specific defines through target properties.
jkoritzinsky Sep 20, 2019
b67e02f
First pass of consolidation of singularly nested CMakeLists.txt files.
jkoritzinsky Sep 20, 2019
42b9d11
Convert metadata libraries to not use leaf folders for dac/runtime/cr…
jkoritzinsky Sep 26, 2019
9f89285
Clean up some of the non-arm assembly file handling.
jkoritzinsky Sep 27, 2019
d0e7b16
Encapsulate arm/arm64 manual preprocessing and compilation of assembl…
jkoritzinsky Sep 27, 2019
a25af23
Fix typo.
jkoritzinsky Sep 27, 2019
6387772
Convert usages of add_precompiled_header to target_precompile_header …
jkoritzinsky Sep 27, 2019
bff1968
Clean up/remove some leaf CMake files that are just simple target cre…
jkoritzinsky Sep 27, 2019
11ddbc6
Remove unused CMakeLists file and folder.
jkoritzinsky Sep 27, 2019
b6eaf0b
Clean up coreclr/CMakeLists.txt
jkoritzinsky Sep 27, 2019
bfcef55
Remove conditions based on CMake version (since we're unifying on CMa…
jkoritzinsky Sep 28, 2019
8ffc90b
Convert final usages of add_precompiled_header to target_precompile_h…
jkoritzinsky Oct 1, 2019
99d7db1
Handle the AsmConstants.inc inclusion in cee_wks by marking it a head…
jkoritzinsky Oct 1, 2019
df3cde4
Move from deprecated FindPythonInterp module to FindPython module.
jkoritzinsky Oct 1, 2019
b9c1878
Remove unused jitpch.cpp
jkoritzinsky Oct 1, 2019
1c2c84b
Fix typo.
jkoritzinsky Oct 1, 2019
9dcb773
Have get_compile_definitions correctly split out generator expression…
jkoritzinsky Oct 1, 2019
61eec15
preprocess_def_file -> preprocess_file and make it work xplat.
jkoritzinsky Oct 1, 2019
79595b4
Fix test build.
jkoritzinsky Oct 2, 2019
4b59108
Merge branch 'cmake-3.14-cleanup' of https://github.com/jkoritzinsky/…
jkoritzinsky Oct 2, 2019
3ac8708
Fix typo in flag.
jkoritzinsky Oct 3, 2019
9b64813
Fix resource building on non-windows.
jkoritzinsky Oct 3, 2019
2534eef
Fix other linker flag typo I missed.
jkoritzinsky Oct 3, 2019
15dc0d9
Add missing eventing_headers dependency.
jkoritzinsky Oct 3, 2019
8c23927
Merge branch 'cmake-3.14-cleanup' of https://github.com/jkoritzinsky/…
jkoritzinsky Oct 3, 2019
61f763e
Fix multivalued generator expression.
jkoritzinsky Oct 3, 2019
b760470
Use CMake 3.x features to significantly simplify toolchain.cmake.
jkoritzinsky Oct 3, 2019
a1de66c
Remove references to LLDB from gen-buildsys-* (these aren't needed si…
jkoritzinsky Oct 3, 2019
f85e525
Remove debugging line
jkoritzinsky Oct 4, 2019
cc9c638
Check check_pie_supported
jkoritzinsky Oct 4, 2019
a555065
Clean up link flags.
jkoritzinsky Oct 4, 2019
e794549
Fix copy-paste typo
jkoritzinsky Oct 4, 2019
b9679d4
Cleanup. Change some conditions in configurecompiler to check for MSV…
jkoritzinsky Oct 4, 2019
a4f3464
Restore the llldb include and library path searching.
jkoritzinsky Oct 4, 2019
8c2da3d
Restore asmconstants_inc custom target.
jkoritzinsky Oct 4, 2019
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: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ project(CoreCLR)
# Include cmake functions
include(functions.cmake)

# Verify that LTCG/LTO is available
include(configure.cmake)

if (WIN32)
message(STATUS "VS_PLATFORM_TOOLSET is ${CMAKE_VS_PLATFORM_TOOLSET}")
message(STATUS "VS_PLATFORM_NAME is ${CMAKE_VS_PLATFORM_NAME}")
Expand Down
2 changes: 0 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,6 @@ if %__BuildNative% EQU 1 (

echo %__MsgPrefix%Regenerating the Visual Studio solution

echo Cross Arch Defines !___CrossBuildDefine!

pushd "%__IntermediatesDir%"
set __ExtraCmakeArgs=!___SDKVersion! !___CrossBuildDefine! "-DCLR_CMAKE_TARGET_OS=%__BuildOS%" "-DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_VERSION=%__PgoOptDataVersion%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%"
call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!
Expand Down
42 changes: 29 additions & 13 deletions clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ if (PRERELEASE)
# add_definitions(-DFEATURE_XXX)
endif (PRERELEASE)

add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>:DACCESS_COMPILE>)
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:CROSSGEN_COMPILE>)
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:CROSS_COMPILE>)
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:FEATURE_NATIVE_IMAGE_GENERATION>)
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:SELF_NO_HOST>)

if (CLR_CMAKE_TARGET_ARCH_AMD64)
if (CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DDBG_TARGET_AMD64_UNIX)
Expand Down Expand Up @@ -73,7 +79,8 @@ endif(CLR_CMAKE_PLATFORM_ALPINE_LINUX)

add_definitions(-D_BLD_CLR)
add_definitions(-DDEBUGGING_SUPPORTED)
add_definitions(-DPROFILING_SUPPORTED)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>>:PROFILING_SUPPORTED>)
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>:PROFILING_SUPPORTED_DATA>)

if(WIN32)
add_definitions(-DWIN32)
Expand All @@ -85,9 +92,9 @@ if(WIN32)
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
# Only enable edit and continue on windows x86 and x64
# exclude Linux, arm & arm64
add_definitions(-DEnC_SUPPORTED)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:EnC_SUPPORTED>)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
endif(WIN32)
endif(WIN32)

# Features - please keep them alphabetically sorted
if(WIN32)
Expand All @@ -100,7 +107,7 @@ else(WIN32)
add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
add_definitions(-DFEATURE_MULTICASTSTUB_AS_IL)
endif(WIN32)
add_definitions(-DFEATURE_CODE_VERSIONING)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_CODE_VERSIONING>)
add_definitions(-DFEATURE_COLLECTIBLE_TYPES)

if(WIN32)
Expand All @@ -121,7 +128,7 @@ if(FEATURE_DBGIPC)
endif(FEATURE_DBGIPC)
add_definitions(-DFEATURE_DEFAULT_INTERFACES)
if(FEATURE_EVENT_TRACE)
add_definitions(-DFEATURE_EVENT_TRACE)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_EVENT_TRACE>)
add_definitions(-DFEATURE_PERFTRACING)
endif(FEATURE_EVENT_TRACE)
if(FEATURE_GDBJIT)
Expand All @@ -148,7 +155,7 @@ if (WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386 OR CLR_
add_definitions(-DFEATURE_INTEROP_DEBUGGING)
endif (WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_ARM64))
if(FEATURE_INTERPRETER)
add_definitions(-DFEATURE_INTERPRETER)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_INTERPRETER>)
endif(FEATURE_INTERPRETER)
add_definitions(-DFEATURE_ISYM_READER)
if (CLR_CMAKE_PLATFORM_LINUX OR WIN32)
Expand All @@ -159,27 +166,36 @@ add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS)
if(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
endif(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MULTICOREJIT)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_MULTICOREJIT>)
if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_PAL)
add_definitions(-DFEATURE_PAL_ANSI)
endif(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD)
if(CLR_CMAKE_PLATFORM_LINUX)
janvorli marked this conversation as resolved.
Show resolved Hide resolved
add_definitions(-DFEATURE_PERFMAP)
endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD)
endif(CLR_CMAKE_PLATFORM_LINUX)
if(CLR_CMAKE_PLATFORM_FREEBSD)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_PERFMAP>)
endif(CLR_CMAKE_PLATFORM_FREEBSD)
if(FEATURE_PREJIT)
add_definitions(-DFEATURE_PREJIT)
else()
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:FEATURE_PREJIT>)
endif(FEATURE_PREJIT)

if(WIN32 OR CLR_CMAKE_PLATFORM_LINUX)
add_definitions(-DFEATURE_PROFAPI_ATTACH_DETACH)
add_compile_definitions($<$<AND:$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>,$<NOT:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>>>:FEATURE_PROFAPI_ATTACH_DETACH>)
endif(WIN32 OR CLR_CMAKE_PLATFORM_LINUX)

add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>:DATA_PROFAPI_ATTACH_DETACH>)

add_definitions(-DFEATURE_READYTORUN)

add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:FEATURE_READYTORUN_COMPILER>)
set(FEATURE_READYTORUN 1)

if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DFEATURE_REJIT)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_REJIT>)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)

if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
Expand All @@ -193,7 +209,7 @@ if (FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION)
endif(FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION)
add_definitions(-DFEATURE_SVR_GC)
add_definitions(-DFEATURE_SYMDIFF)
add_definitions(-DFEATURE_TIERED_COMPILATION)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_TIERED_COMPILATION>)
if (WIN32)
add_definitions(-DFEATURE_TYPEEQUIVALENCE)
endif(WIN32)
Expand All @@ -216,7 +232,7 @@ if((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN3
endif((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)

if(WIN32)
add_definitions(-DFEATURE_VERSIONING_LOG)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_VERSIONING_LOG>)
endif(WIN32)
if(NOT CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_WIN32_REGISTRY)
Expand Down
15 changes: 0 additions & 15 deletions configure.cmake

This file was deleted.

Loading