Skip to content

Commit

Permalink
Rename CLR_CMAKE_PLATFORM* CLR_CMAKE_HOST* (#1974)
Browse files Browse the repository at this point in the history
The term platform was ambiguous. Migrate to using common terminology for
cross compilation.

Host is the platfrom which will execute the code
Target is the platform which will be debugged or for which code will be generated.

In most cases HOST == TARGET.  The exceptions are the cross component crossgen
tools and the future cross DAC.
  • Loading branch information
sdmaclea authored Jan 21, 2020
1 parent 644bdd9 commit 696e72b
Show file tree
Hide file tree
Showing 55 changed files with 316 additions and 316 deletions.
8 changes: 4 additions & 4 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ include(pgosupport.cmake)
# - project which require platform header not clr's
# - do not depend on clr's compile definitions
#-----------------------------------------
if(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_HOST_UNIX)
add_subdirectory(src/pal)
add_subdirectory(src/hosts)
endif(CLR_CMAKE_PLATFORM_UNIX)
endif(CLR_CMAKE_HOST_UNIX)

# Add this subdir. We install the headers for the jit.
add_subdirectory(src/pal/prebuilt/inc)
Expand Down Expand Up @@ -177,11 +177,11 @@ if(FEATURE_STANDALONE_GC)
add_subdirectory(src/gc)
endif(FEATURE_STANDALONE_GC)

if (CLR_CMAKE_PLATFORM_UNIX)
if (CLR_CMAKE_HOST_UNIX)
include_directories("src/pal/inc")
include_directories("src/pal/inc/rt")
include_directories("src/pal/src/safecrt")
endif (CLR_CMAKE_PLATFORM_UNIX)
endif (CLR_CMAKE_HOST_UNIX)

#------------------------------
# Add Product Directory
Expand Down
76 changes: 38 additions & 38 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:FEATURE_
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:SELF_NO_HOST>)

if (CLR_CMAKE_TARGET_ARCH_AMD64)
if (CLR_CMAKE_PLATFORM_UNIX)
if (CLR_CMAKE_HOST_UNIX)
add_definitions(-DDBG_TARGET_AMD64_UNIX)
endif()
add_definitions(-D_TARGET_AMD64_)
add_definitions(-D_TARGET_64BIT_)
add_definitions(-DDBG_TARGET_64BIT)
add_definitions(-DDBG_TARGET_AMD64)
elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
if (CLR_CMAKE_PLATFORM_UNIX)
if (CLR_CMAKE_HOST_UNIX)
add_definitions(-DDBG_TARGET_ARM64_UNIX)
add_definitions(-DFEATURE_EMULATE_SINGLESTEP)
endif()
Expand All @@ -35,13 +35,13 @@ elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DDBG_TARGET_ARM64)
add_definitions(-DFEATURE_MULTIREG_RETURN)
elseif (CLR_CMAKE_TARGET_ARCH_ARM)
if (CLR_CMAKE_PLATFORM_UNIX)
if (CLR_CMAKE_HOST_UNIX)
add_definitions(-DDBG_TARGET_ARM_UNIX)
elseif (WIN32 AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)
# Set this to ensure we can use Arm SDK for Desktop binary linkage when doing native (Arm32) build
add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
add_definitions(-D_ARM_WORKAROUND_)
endif (CLR_CMAKE_PLATFORM_UNIX)
endif (CLR_CMAKE_HOST_UNIX)
add_definitions(-D_TARGET_ARM_)
add_definitions(-DDBG_TARGET_32BIT)
add_definitions(-DDBG_TARGET_ARM)
Expand All @@ -54,12 +54,12 @@ else ()
clr_unknown_arch()
endif (CLR_CMAKE_TARGET_ARCH_AMD64)

if (CLR_CMAKE_PLATFORM_UNIX)
if (CLR_CMAKE_HOST_UNIX)

if(CLR_CMAKE_PLATFORM_DARWIN)
if(CLR_CMAKE_HOST_DARWIN)
add_definitions(-D_XOPEN_SOURCE)
add_definitions(-DFEATURE_DATATARGET4)
endif(CLR_CMAKE_PLATFORM_DARWIN)
endif(CLR_CMAKE_HOST_DARWIN)

if (CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DUNIX_AMD64_ABI)
Expand All @@ -69,13 +69,13 @@ if (CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DUNIX_X86_ABI)
endif()

endif(CLR_CMAKE_PLATFORM_UNIX)
endif(CLR_CMAKE_HOST_UNIX)

if(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
if(CLR_CMAKE_HOST_ALPINE_LINUX)
# Alpine Linux doesn't have fixed stack limit, this define disables some stack pointer
# sanity checks in debug / checked build that rely on a fixed stack limit
add_definitions(-DNO_FIXED_STACK_LIMIT)
endif(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
endif(CLR_CMAKE_HOST_ALPINE_LINUX)

add_definitions(-D_BLD_CLR)
add_definitions(-DDEBUGGING_SUPPORTED)
Expand Down Expand Up @@ -112,7 +112,7 @@ if(NOT CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DFEATURE_PORTABLE_SHUFFLE_THUNKS)
endif()

if(CLR_CMAKE_PLATFORM_UNIX OR NOT CLR_CMAKE_TARGET_ARCH_I386)
if(CLR_CMAKE_HOST_UNIX OR NOT CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DFEATURE_INSTANTIATINGSTUB_AS_IL)
endif()

Expand Down Expand Up @@ -152,9 +152,9 @@ endif(FEATURE_GDBJIT_LANGID_CS)
if(FEATURE_GDBJIT_SYMTAB)
add_definitions(-DFEATURE_GDBJIT_SYMTAB)
endif(FEATURE_GDBJIT_SYMTAB)
if(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_HOST_UNIX)
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT)
endif(CLR_CMAKE_PLATFORM_UNIX)
endif(CLR_CMAKE_HOST_UNIX)
# NetBSD doesn't implement this feature
if(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
add_definitions(-DFEATURE_HIJACK)
Expand All @@ -167,34 +167,34 @@ if(FEATURE_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)
if (CLR_CMAKE_HOST_LINUX OR WIN32)
add_definitions(-DFEATURE_MANAGED_ETW)
endif(CLR_CMAKE_PLATFORM_LINUX OR WIN32)
endif(CLR_CMAKE_HOST_LINUX OR WIN32)
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_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_MULTICOREJIT>)
if(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_HOST_UNIX)
add_definitions(-DFEATURE_PAL)
add_definitions(-DFEATURE_PAL_ANSI)
endif(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_LINUX)
endif(CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_HOST_LINUX)
add_definitions(-DFEATURE_PERFMAP)
endif(CLR_CMAKE_PLATFORM_LINUX)
if(CLR_CMAKE_PLATFORM_FREEBSD)
endif(CLR_CMAKE_HOST_LINUX)
if(CLR_CMAKE_HOST_FREEBSD)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_PERFMAP>)
endif(CLR_CMAKE_PLATFORM_FREEBSD)
endif(CLR_CMAKE_HOST_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)
if(WIN32 OR CLR_CMAKE_HOST_LINUX)
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)
endif(WIN32 OR CLR_CMAKE_HOST_LINUX)

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

Expand All @@ -205,7 +205,7 @@ set(FEATURE_READYTORUN 1)

add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_REJIT>)

if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
if (CLR_CMAKE_HOST_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DFEATURE_STUBS_AS_IL)
endif ()
if (FEATURE_NGEN_RELOCS_OPTIMIZATIONS)
Expand All @@ -220,27 +220,27 @@ add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:F
if (WIN32)
add_definitions(-DFEATURE_TYPEEQUIVALENCE)
endif(WIN32)
if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
if (CLR_CMAKE_HOST_ARCH_AMD64)
# Enable the AMD64 Unix struct passing JIT-EE interface for all AMD64 platforms, to enable altjit.
add_definitions(-DUNIX_AMD64_ABI_ITF)
endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
endif (CLR_CMAKE_HOST_ARCH_AMD64)
if(CLR_CMAKE_HOST_UNIX_AMD64)
add_definitions(-DFEATURE_MULTIREG_RETURN)
endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
if(CLR_CMAKE_PLATFORM_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64)
endif (CLR_CMAKE_HOST_UNIX_AMD64)
if(CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DUNIX_AMD64_ABI)
endif(CLR_CMAKE_PLATFORM_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64)
endif(CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
if(CLR_CMAKE_HOST_ARCH_AMD64 OR CLR_CMAKE_HOST_ARCH_ARM64)
add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
endif(CLR_CMAKE_HOST_ARCH_AMD64 OR CLR_CMAKE_HOST_ARCH_ARM64)
if(CLR_CMAKE_HOST_ARCH_AMD64 OR CLR_CMAKE_HOST_ARCH_ARM64)
add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES)
endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
endif(CLR_CMAKE_HOST_ARCH_AMD64 OR CLR_CMAKE_HOST_ARCH_ARM64)

if(NOT CLR_CMAKE_PLATFORM_UNIX)
if(NOT CLR_CMAKE_HOST_UNIX)
add_definitions(-DFEATURE_WIN32_REGISTRY)
endif(NOT CLR_CMAKE_PLATFORM_UNIX)
endif(NOT CLR_CMAKE_HOST_UNIX)
add_definitions(-DFEATURE_WINMD_RESILIENT)
add_definitions(-D_SECURE_SCL=0)
add_definitions(-DUNICODE)
Expand All @@ -252,9 +252,9 @@ if(WIN32)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
endif(WIN32)

if(CLR_CMAKE_PLATFORM_DARWIN)
if(CLR_CMAKE_HOST_DARWIN)
add_definitions(-DFEATURE_WRITEBARRIER_COPY)
endif(CLR_CMAKE_PLATFORM_DARWIN)
endif(CLR_CMAKE_HOST_DARWIN)

if (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT WIN32)
add_definitions(-DFEATURE_EH_FUNCLETS)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/clrfeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT DEFINED FEATURE_PERFTRACING AND FEATURE_EVENT_TRACE)
endif(NOT DEFINED FEATURE_PERFTRACING AND FEATURE_EVENT_TRACE)

if(NOT DEFINED FEATURE_DBGIPC)
if(CLR_CMAKE_PLATFORM_UNIX AND (NOT CLR_CMAKE_PLATFORM_ANDROID))
if(CLR_CMAKE_HOST_UNIX AND (NOT CLR_CMAKE_HOST_ANDROID))
set(FEATURE_DBGIPC 1)
endif()
endif(NOT DEFINED FEATURE_DBGIPC)
Expand Down
Loading

0 comments on commit 696e72b

Please sign in to comment.