# 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}")
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!
# add_definitions(-DFEATURE_XXX)
endif (PRERELEASE)
+add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>:DACCESS_COMPILE>)
+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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
+++ /dev/null
-include(CheckCXXSourceCompiles)
-include(CheckCXXCompilerFlag)
-
-# VC++ guarantees support for LTCG (LTO's equivalent)
-if(NOT WIN32)
- # Function required to give CMAKE_REQUIRED_* local scope
- function(check_have_lto)
- set(CMAKE_REQUIRED_FLAGS -flto)
- set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold)
- check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO)
- endfunction(check_have_lto)
- check_have_lto()
-
- check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW)
-endif(NOT WIN32)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
+cmake_policy(SET CMP0083 NEW)
+
+include(CheckPIESupported)
+include(CheckCXXCompilerFlag)
+
# All code we build should be compiled as position independent
+check_pie_supported(OUTPUT_VARIABLE PIE_SUPPORT_OUTPUT LANGUAGES CXX)
+if(NOT MSVC AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
+ message(WARNING "PIE is not supported at link time: ${PIE_SUPPORT_OUTPUT}.\n"
+ "PIE link options will not be passed to linker.")
+endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-set(CLR_DEFINES_DEBUG_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
-set(CLR_DEFINES_CHECKED_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
-set(CLR_DEFINES_RELEASE_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
-set(CLR_DEFINES_RELWITHDEBINFO_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
+check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW)
#----------------------------------------
# Detect and set platform variable names
# Initialize Cmake compiler flags and other variables
#-----------------------------------------------------
-if(WIN32)
+if(MSVC)
add_compile_options(/Zi /FC /Zc:strictStrings)
elseif (CLR_CMAKE_PLATFORM_UNIX)
add_compile_options(-g)
set(CMAKE_EXE_LINKER_FLAGS_CHECKED "")
set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "")
-set(CMAKE_CXX_STANDARD_LIBRARIES "") # do not link against standard win32 libs i.e. kernel32, uuid, user32, etc.
+add_compile_definitions("$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>:DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1>")
+add_compile_definitions("$<$<OR:$<CONFIG:RELEASE>,$<CONFIG:RELWITHDEBINFO>>:NDEBUG;URTBLDENV_FRIENDLY=Retail>")
-if (WIN32)
- # For multi-configuration toolset (as Visual Studio)
- # set the different configuration defines.
- foreach (Config DEBUG CHECKED RELEASE RELWITHDEBINFO)
- foreach (Definition IN LISTS CLR_DEFINES_${Config}_INIT)
- set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${Config}>:${Definition}>)
- endforeach (Definition)
- endforeach (Config)
+set(CMAKE_CXX_STANDARD_LIBRARIES "") # do not link against standard win32 libs i.e. kernel32, uuid, user32, etc.
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /GUARD:CF")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")
+if (MSVC)
+ add_link_options(/GUARD:CF)
# Linker flags
#
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") #Do not create Side-by-Side Assembly Manifest
+ set (WINDOWS_SUBSYSTEM_VERSION 6.01)
if (CLR_CMAKE_PLATFORM_ARCH_ARM)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.02") #windows subsystem - arm minimum is 6.02
+ set(WINDOWS_SUBSYSTEM_VERSION 6.02) #windows subsystem - arm minimum is 6.02
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.03") #windows subsystem - arm64 minimum is 6.03
- else ()
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.01") #windows subsystem
+ set(WINDOWS_SUBSYSTEM_VERSION 6.03) #windows subsystem - arm64 minimum is 6.03
endif ()
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") # can handle addresses larger than 2 gigabytes
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NXCOMPAT") #Compatible with Data Execution Prevention
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE") #Use address space layout randomization
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /PDBCOMPRESS") #shrink pdb size
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /IGNORE:4197,4013,4254,4070,4221")
+ #Do not create Side-by-Side Assembly Manifest
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/MANIFEST:NO>)
+ # can handle addresses larger than 2 gigabytes
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/LARGEADDRESSAWARE>)
+ #Compatible with Data Execution Prevention
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/NXCOMPAT>)
+ #Use address space layout randomization
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/DYNAMICBASE>)
+ #shrink pdb size
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/PDBCOMPRESS>)
+
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/DEBUG>)
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/IGNORE:4197,4013,4254,4070,4221>)
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:/SUBSYSTEM:WINDOWS,${WINDOWS_SUBSYSTEM_VERSION}>)
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
-
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864")
+
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/DEBUG>)
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/PDBCOMPRESS>)
+ add_link_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/STACK:1572864>)
# Debug build specific flags
- set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE ${NO_INCREMENTAL_LINKER_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${NO_INCREMENTAL_LINKER_FLAGS}")
+ add_link_options($<$<AND:$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>>:/NOVCFEATURE>)
# Checked build specific flags
- set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "${CMAKE_SHARED_LINKER_FLAGS_CHECKED} /OPT:REF /OPT:NOICF /NOVCFEATURE ${NO_INCREMENTAL_LINKER_FLAGS}")
- set(CMAKE_STATIC_LINKER_FLAGS_CHECKED "${CMAKE_STATIC_LINKER_FLAGS_CHECKED}")
- set(CMAKE_EXE_LINKER_FLAGS_CHECKED "${CMAKE_EXE_LINKER_FLAGS_CHECKED} /OPT:REF /OPT:NOICF ${NO_INCREMENTAL_LINKER_FLAGS}")
+ add_link_options($<$<CONFIG:CHECKED>:/OPT:REF>)
+ add_link_options($<$<CONFIG:CHECKED>:/OPT:NOICF>)
# Release build specific flags
- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG /OPT:REF /OPT:ICF ${NO_INCREMENTAL_LINKER_FLAGS}")
+ add_link_options($<$<CONFIG:RELEASE>:/LTCG>)
+ add_link_options($<$<CONFIG:RELEASE>:/OPT:REF>)
+ add_link_options($<$<CONFIG:RELEASE>:/OPT:ICF>)
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG /OPT:REF /OPT:ICF ${NO_INCREMENTAL_LINKER_FLAGS}")
# ReleaseWithDebugInfo build specific flags
- set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG /OPT:REF /OPT:ICF ${NO_INCREMENTAL_LINKER_FLAGS}")
+ add_link_options($<$<CONFIG:RELWITHDEBINFO>:/LTCG>)
+ add_link_options($<$<CONFIG:RELWITHDEBINFO>:/OPT:REF>)
+ add_link_options($<$<CONFIG:RELWITHDEBINFO>:/OPT:ICF>)
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}")
# 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")
- set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+ add_link_options("$<$<CONFIG:RELEASE>:/NODEFAULTLIB:libucrt.lib;/DEFAULTLIB:ucrt.lib>")
elseif (CLR_CMAKE_PLATFORM_UNIX)
# Set the values to display when interactively configuring CMAKE_BUILD_TYPE
# Use uppercase CMAKE_BUILD_TYPE for the string comparisons below
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
- # For single-configuration toolset
- # set the different configuration defines.
- if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG)
- # First DEBUG
- set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${CLR_DEFINES_DEBUG_INIT})
- elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
- # Then CHECKED
- set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${CLR_DEFINES_CHECKED_INIT})
- elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE)
- # Then RELEASE
- set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${CLR_DEFINES_RELEASE_INIT})
- elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
- # And then RELWITHDEBINFO
- set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${CLR_DEFINES_RELWITHDEBINFO_INIT})
- else ()
- message(FATAL_ERROR "Unknown build type! Set CMAKE_BUILD_TYPE to DEBUG, CHECKED, RELEASE, or RELWITHDEBINFO!")
- endif ()
+ set(CLR_SANITIZE_CXX_OPTIONS "")
+ set(CLR_SANITIZE_LINK_OPTIONS "")
# set the CLANG sanitizer flags for debug build
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
string(FIND "$ENV{DEBUG_SANITIZERS}" "asan" __ASAN_POS)
string(FIND "$ENV{DEBUG_SANITIZERS}" "ubsan" __UBSAN_POS)
if ((${__ASAN_POS} GREATER -1) OR (${__UBSAN_POS} GREATER -1))
- set(CLR_SANITIZE_CXX_FLAGS "${CLR_SANITIZE_CXX_FLAGS} -fsanitize-blacklist=${CMAKE_CURRENT_SOURCE_DIR}/sanitizerblacklist.txt -fsanitize=")
- set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS} -fsanitize=")
+ list(APPEND CLR_SANITIZE_CXX_OPTIONS -fsanitize-blacklist=${CMAKE_CURRENT_SOURCE_DIR}/sanitizerblacklist.txt)
+ set (CLR_CXX_SANITIZERS "")
+ set (CLR_LINK_SANITIZERS "")
if (${__ASAN_POS} GREATER -1)
+ list(APPEND CLR_CXX_SANITIZERS address)
+ list(APPEND CLR_LINK_SANITIZERS address)
set(CLR_SANITIZE_CXX_FLAGS "${CLR_SANITIZE_CXX_FLAGS}address,")
set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS}address,")
add_definitions(-DHAS_ASAN)
endif ()
if (${__UBSAN_POS} GREATER -1)
# all sanitizier flags are enabled except alignment (due to heavy use of __unaligned modifier)
- set(CLR_SANITIZE_CXX_FLAGS "${CLR_SANITIZE_CXX_FLAGS}bool,bounds,enum,float-cast-overflow,float-divide-by-zero,function,integer,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift,unreachable,vla-bound,vptr")
- set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS}undefined")
+ list(APPEND CLR_CXX_SANITIZERS
+ "bool"
+ bounds
+ enum
+ float-cast-overflow
+ float-divide-by-zero
+ "function"
+ integer
+ nonnull-attribute
+ null
+ object-size
+ "return"
+ returns-nonnull-attribute
+ shift
+ unreachable
+ vla-bound
+ vptr)
+ list(APPEND CLR_LINK_SANITIZERS
+ undefined)
message("Undefined Behavior Sanitizer (ubsan) enabled")
endif ()
+ list(JOIN CLR_CXX_SANITIZERS "," CLR_CXX_SANITIZERS_OPTIONS)
+ list(APPEND CLR_SANITIZE_CXX_OPTIONS "-fsanitize=${CLR_CXX_SANITIZERS_OPTIONS}")
+ list(JOIN CLR_LINK_SANITIZERS "," CLR_LINK_SANITIZERS_OPTIONS)
+ list(APPEND CLR_SANITIZE_LINK_OPTIONS "-fsanitize=${CLR_LINK_SANITIZERS_OPTIONS}")
# -fdata-sections -ffunction-sections: each function has own section instead of one per .o file (needed for --gc-sections)
# -O1: optimization level used instead of -O0 to avoid compile error "invalid operand for inline asm constraint"
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CLR_SANITIZE_CXX_FLAGS} -fdata-sections -ffunction-sections -O1")
- set(CMAKE_CXX_FLAGS_CHECKED "${CMAKE_CXX_FLAGS_CHECKED} ${CLR_SANITIZE_CXX_FLAGS} -fdata-sections -ffunction-sections -O1")
-
- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${CLR_SANITIZE_LINK_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS_CHECKED "${CMAKE_EXE_LINKER_FLAGS_CHECKED} ${CLR_SANITIZE_LINK_FLAGS}")
+ add_compile_definitions("$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>:${CLR_SANITIZE_CXX_OPTIONS};-fdata-sections;--ffunction-sections;-O1>")
+ add_link_options($<$<AND:$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>>:${CLR_SANITIZE_LINK_OPTIONS}>)
# -Wl and --gc-sections: drop unused sections\functions (similar to Windows /Gy function-level-linking)
- set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${CLR_SANITIZE_LINK_FLAGS} -Wl,--gc-sections")
- set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "${CMAKE_SHARED_LINKER_FLAGS_CHECKED} ${CLR_SANITIZE_LINK_FLAGS} -Wl,--gc-sections")
+ add_link_options("$<$<AND:$<OR:$<CONFIG:DEBUG>,$<CONFIG:CHECKED>>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>>:${CLR_SANITIZE_LINK_OPTIONS};-Wl,--gc-sections>")
endif ()
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
-
- # This linker option causes executables we build to be marked as containing position independent code.
- # It is necessary to make ASLR work for executables.
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie" )
-
-endif(WIN32)
+endif(MSVC)
# CLR_ADDITIONAL_LINKER_FLAGS - used for passing additional arguments to linker
# CLR_ADDITIONAL_COMPILER_OPTIONS - used for passing additional arguments to compiler
# ./build-native.sh cmakeargs "-DCLR_ADDITIONAL_COMPILER_OPTIONS=<...>" cmakeargs "-DCLR_ADDITIONAL_LINKER_FLAGS=<...>"
#
if(CLR_CMAKE_PLATFORM_UNIX)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CLR_ADDITIONAL_LINKER_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLR_ADDITIONAL_LINKER_FLAGS}" )
+ add_link_options(${CLR_ADDITIONAL_LINKER_FLAGS})
endif(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_LINUX)
- set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1")
+ add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
+ add_link_options(-Wl,--build-id=sha1)
endif(CLR_CMAKE_PLATFORM_LINUX)
if(CLR_CMAKE_PLATFORM_FREEBSD)
- set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld -Xlinker --build-id=sha1")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -Xlinker --build-id=sha1")
+ add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
+ add_link_options(-fuse-ld=lld LINKER:--build-id=sha1)
endif(CLR_CMAKE_PLATFORM_FREEBSD)
#------------------------------------
# Specify the minimum supported version of macOS
if(CLR_CMAKE_PLATFORM_DARWIN)
- set(MACOS_VERSION_MIN_FLAGS "-mmacosx-version-min=10.12")
- add_compile_options("${MACOS_VERSION_MIN_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MACOS_VERSION_MIN_FLAGS}")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MACOS_VERSION_MIN_FLAGS}")
+ set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.12)
+ add_compile_options(${MACOS_VERSION_MIN_FLAGS})
+ add_link_options(${MACOS_VERSION_MIN_FLAGS})
endif(CLR_CMAKE_PLATFORM_DARWIN)
endif(CLR_CMAKE_PLATFORM_UNIX)
add_compile_options(${CLR_ADDITIONAL_COMPILER_OPTIONS})
endif(CLR_CMAKE_PLATFORM_UNIX)
-if (WIN32)
+if (MSVC)
# Compile options for targeting windows
# The following options are set by the razzle build
# For Release builds, we shall dynamically link into uCRT [ucrtbase.dll] (which is pushed down as a Windows Update on downlevel OS) but
# wont do the same for debug/checked builds since ucrtbased.dll is not redistributable and Debug/Checked builds are not
# production-time scenarios.
- add_compile_options($<$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>:/MT>)
- add_compile_options($<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:/MTd>)
- set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /ZH:SHA_256")
+ add_compile_options($<$<OR:$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>,$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>>:/MT>)
+ add_compile_options($<$<AND:$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>,$<NOT:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>>>:/MTd>)
+
+ add_compile_options($<$<COMPILE_LANGUAGE:ASM_MASM>:/ZH:SHA_256>)
if (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
# Contracts work too slow on ARM/ARM64 DEBUG/CHECKED.
add_definitions(-DDISABLE_CONTRACTS)
endif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
-endif (WIN32)
+endif (MSVC)
if(CLR_CMAKE_ENABLE_CODE_COVERAGE)
add_compile_options(-fprofile-arcs)
add_compile_options(-ftest-coverage)
- set(CLANG_COVERAGE_LINK_FLAGS "--coverage")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CLANG_COVERAGE_LINK_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLANG_COVERAGE_LINK_FLAGS}")
+ add_link_options(--coverage)
else()
message(FATAL_ERROR "Code coverage builds not supported on current platform")
endif(CLR_CMAKE_PLATFORM_UNIX)
set(TOOLCHAIN $ENV{TOOLCHAIN})
endif()
-# This gets called with CLR_CMAKE_COMPILER set on the first invocation
-# but the cmake variable is not getting populated into other calls.
-# Use environment variable to keep CLR_CMAKE_COMPILER around.
-if (NOT DEFINED CLR_CMAKE_COMPILER)
- set(CLR_CMAKE_COMPILER $ENV{CLR_CMAKE_COMPILER})
-else()
- set(ENV{CLR_CMAKE_COMPILER} ${CLR_CMAKE_COMPILER})
-endif()
-
# Specify include paths
if(TARGET_ARCH_NAME STREQUAL "armel")
if(DEFINED TIZEN_TOOLCHAIN)
endif()
endif()
-# add_compile_param - adds only new options without duplicates.
-# arg0 - list with result options, arg1 - list with new options.
-# arg2 - optional argument, quick summary string for optional using CACHE FORCE mode.
-macro(add_compile_param)
- if(NOT ${ARGC} MATCHES "^(2|3)$")
- message(FATAL_ERROR "Wrong using add_compile_param! Two or three parameters must be given! See add_compile_param description.")
- endif()
- foreach(OPTION ${ARGV1})
- if(NOT ${ARGV0} MATCHES "${OPTION}($| )")
- set(${ARGV0} "${${ARGV0}} ${OPTION}")
- if(${ARGC} EQUAL "3") # CACHE FORCE mode
- set(${ARGV0} "${${ARGV0}}" CACHE STRING "${ARGV2}" FORCE)
- endif()
- endif()
- endforeach()
-endmacro()
+set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
+set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
+set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
+set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
# Specify link flags
-add_compile_param(CROSS_LINK_FLAGS "--sysroot=${CROSS_ROOTFS}")
-if (CLR_CMAKE_COMPILER STREQUAL "Clang")
- add_compile_param(CROSS_LINK_FLAGS "--gcc-toolchain=${CROSS_ROOTFS}/usr")
- add_compile_param(CROSS_LINK_FLAGS "--target=${TOOLCHAIN}")
-endif()
if(TARGET_ARCH_NAME STREQUAL "armel")
if(DEFINED TIZEN_TOOLCHAIN) # For Tizen only
- add_compile_param(CROSS_LINK_FLAGS "-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
- add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/lib")
- add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/usr/lib")
- add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+ add_link_options("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+ add_link_options("-L${CROSS_ROOTFS}/lib")
+ add_link_options("-L${CROSS_ROOTFS}/usr/lib")
+ add_link_options("-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
- add_compile_param(CROSS_LINK_FLAGS "-m32")
+ add_link_options(-m32)
endif()
-add_compile_param(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS")
-add_compile_param(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS")
-add_compile_param(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS")
-
# Specify compile options
-add_compile_options("--sysroot=${CROSS_ROOTFS}")
-if (CLR_CMAKE_COMPILER STREQUAL "Clang")
- add_compile_options("--target=${TOOLCHAIN}")
- add_compile_options("--gcc-toolchain=${CROSS_ROOTFS}/usr")
-endif()
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$")
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
add_compile_options(-Wno-error=unused-command-line-argument)
endif()
-# Set LLDB include and library paths
+# Set LLDB include and library paths for builds that need lldb.
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
if(TARGET_ARCH_NAME STREQUAL "x86")
set(LLVM_CROSS_DIR "$ENV{LLVM_CROSS_HOME}")
endif()
endif()
-set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+++ /dev/null
-# Contains the crossgen build specific definitions. Included by the leaf crossgen cmake files.
-
-add_definitions(
- -DFEATURE_PREJIT
- -DCROSSGEN_COMPILE
- -DCROSS_COMPILE
- -DFEATURE_NATIVE_IMAGE_GENERATION
- -DSELF_NO_HOST)
-
-remove_definitions(
- -DFEATURE_CODE_VERSIONING
- -DEnC_SUPPORTED
- -DFEATURE_EVENT_TRACE
- -DFEATURE_INTERPRETER
- -DFEATURE_MULTICOREJIT
- -DFEATURE_PERFMAP
- -DFEATURE_REJIT
- -DFEATURE_TIERED_COMPILATION
- -DFEATURE_VERSIONING_LOG
- -DFEATURE_PROFAPI_ATTACH_DETACH
-)
-
-if(FEATURE_READYTORUN)
- add_definitions(-DFEATURE_READYTORUN_COMPILER)
-endif(FEATURE_READYTORUN)
-
-if(CLR_CMAKE_PLATFORM_LINUX)
- add_definitions(-DFEATURE_PERFMAP)
-endif(CLR_CMAKE_PLATFORM_LINUX)
+++ /dev/null
-# Contains the dac build specific definitions. Included by the leaf dac cmake files.
-
-add_definitions(-DDACCESS_COMPILE)
-if(WIN32)
- add_definitions(-MT)
-endif(WIN32)
-
-remove_definitions(-DPROFILING_SUPPORTED)
-add_definitions(-DPROFILING_SUPPORTED_DATA)
-
-remove_definitions(-DFEATURE_PROFAPI_ATTACH_DETACH)
-add_definitions(-DDATA_PROFAPI_ATTACH_DETACH)
# Get the current list of definitions
get_directory_property(COMPILE_DEFINITIONS_LIST COMPILE_DEFINITIONS)
+ # The entries that contain generator expressions must have the -D inside of the
+ # expression. So we transform e.g. $<$<CONFIG:Debug>:_DEBUG> to $<$<CONFIG:Debug>:-D_DEBUG>
+
+ # CMake's support for multiple values within a single generator expression is somewhat ad-hoc.
+ # Since we have a number of complex generator expressions, we use them with multiple values to ensure that
+ # we don't forget to update all of the generator expressions if one needs to be updated.
+ # As a result, we need to expand out the multi-valued generator expression to wrap each individual value here.
+ # Otherwise, CMake will fail to expand it.
+ set(LastGeneratorExpression "")
foreach(DEFINITION IN LISTS COMPILE_DEFINITIONS_LIST)
- if (${DEFINITION} MATCHES "^\\$<\\$<CONFIG:([^>]+)>:([^>]+)>$")
- # The entries that contain generator expressions must have the -D inside of the
- # expression. So we transform e.g. $<$<CONFIG:Debug>:_DEBUG> to $<$<CONFIG:Debug>:-D_DEBUG>
- set(DEFINITION "$<$<CONFIG:${CMAKE_MATCH_1}>:-D${CMAKE_MATCH_2}>")
+ # If there is a definition that uses the $<TARGET_PROPERTY:prop> generator expression
+ # we need to remove it since that generator expression is only valid on binary targets.
+ # Assume that the value is 0.
+ string(REGEX REPLACE "\\$<TARGET_PROPERTY:[^,>]+>" "0" DEFINITION "${DEFINITION}")
+
+ if (${DEFINITION} MATCHES "^\\$<(.+):([^>]+)(>?)$")
+ if("${CMAKE_MATCH_3}" STREQUAL "")
+ set(DEFINITION "$<${CMAKE_MATCH_1}:-D${CMAKE_MATCH_2}>")
+ set(LastGeneratorExpression "${CMAKE_MATCH_1}")
else()
- set(DEFINITION -D${DEFINITION})
+ set(DEFINITION "$<${CMAKE_MATCH_1}:-D${CMAKE_MATCH_2}>")
endif()
- list(APPEND DEFINITIONS ${DEFINITION})
+ elseif(${DEFINITION} MATCHES "([^>]+)>$")
+ # This entry is the last in a list nested within a generator expression.
+ set(DEFINITION "$<${LastGeneratorExpression}:-D${CMAKE_MATCH_1}>")
+ set(LastGeneratorExpression "")
+ elseif(NOT "${LastGeneratorExpression}" STREQUAL "")
+ set(DEFINITION "$<${LastGeneratorExpression}:-D${DEFINITION}>")
+ else()
+ set(DEFINITION -D${DEFINITION})
+ endif()
+ list(APPEND DEFINITIONS ${DEFINITION})
endforeach()
set(${DefinitionName} ${DEFINITIONS} PARENT_SCOPE)
endfunction(get_compile_definitions)
set(${RetSources} ${AbsolutePathSources} PARENT_SCOPE)
endfunction(convert_to_absolute_path)
-#Preprocess exports definition file
-function(preprocess_def_file inputFilename outputFilename)
+#Preprocess file
+function(preprocess_file inputFilename outputFilename)
get_compile_definitions(PREPROCESS_DEFINITIONS)
- get_include_directories(ASM_INCLUDE_DIRECTORIES)
- add_custom_command(
- OUTPUT ${outputFilename}
- COMMAND ${CMAKE_CXX_COMPILER} ${ASM_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename}
- DEPENDS ${inputFilename}
- COMMENT "Preprocessing ${inputFilename} - ${CMAKE_CXX_COMPILER} ${ASM_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename}"
- )
+ get_include_directories(PREPROCESS_INCLUDE_DIRECTORIES)
+ if (MSVC)
+ add_custom_command(
+ OUTPUT ${outputFilename}
+ COMMAND ${CMAKE_CXX_COMPILER} ${PREPROCESS_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename}
+ DEPENDS ${inputFilename}
+ COMMENT "Preprocessing ${inputFilename}. Outputting to ${outputFilename}"
+ )
+ else()
+ add_custom_command(
+ OUTPUT ${outputFilename}
+ COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${PREPROCESS_INCLUDE_DIRECTORIES} -o ${outputFilename} -x c ${inputFilename}
+ DEPENDS ${inputFilename}
+ COMMENT "Preprocessing ${inputFilename}. Outputting to ${outputFilename}"
+ )
+ endif()
set_source_files_properties(${outputFilename}
PROPERTIES GENERATED TRUE)
endfunction()
+# preprocess_compile_asm(ASM_FILES file1 [file2 ...] OUTPUT_OBJECTS [variableName])
+function(preprocess_compile_asm)
+ set(options "")
+ set(oneValueArgs OUTPUT_OBJECTS)
+ set(multiValueArgs ASM_FILES)
+ cmake_parse_arguments(PARSE_ARGV 0 COMPILE_ASM "${options}" "${oneValueArgs}" "${multiValueArgs}")
+
+ get_include_directories_asm(ASM_INCLUDE_DIRECTORIES)
+
+ set (ASSEMBLED_OBJECTS "")
+
+ foreach(ASM_FILE ${COMPILE_ASM_ASM_FILES})
+ # Inserts a custom command in CMake build to preprocess each asm source file
+ get_filename_component(name ${ASM_FILE} NAME_WE)
+ file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${name}.asm" ASM_PREPROCESSED_FILE)
+ preprocess_file(${ASM_FILE} ${ASM_PREPROCESSED_FILE})
+
+ # We do not pass any defines since we have already done pre-processing above
+ set (ASM_CMDLINE "-o ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj ${ASM_PREPROCESSED_FILE}")
+
+ # Generate the batch file that will invoke the assembler
+ file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/runasm_${name}.cmd" ASM_SCRIPT_FILE)
+
+ file(GENERATE OUTPUT "${ASM_SCRIPT_FILE}"
+ CONTENT "\"${CMAKE_ASM_MASM_COMPILER}\" -g ${ASM_INCLUDE_DIRECTORIES} ${ASM_CMDLINE}")
+
+ message("Generated - ${ASM_SCRIPT_FILE}")
+
+ # Need to compile asm file using custom command as include directories are not provided to asm compiler
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj
+ COMMAND ${ASM_SCRIPT_FILE}
+ DEPENDS ${ASM_PREPROCESSED_FILE}
+ COMMENT "Assembling ${ASM_PREPROCESSED_FILE} - ${ASM_SCRIPT_FILE}")
+
+ # mark obj as source that does not require compile
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${name}.obj PROPERTIES EXTERNAL_OBJECT TRUE)
+
+ # Add the generated OBJ in the dependency list so that it gets consumed during linkage
+ list(APPEND ASSEMBLED_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj)
+ endforeach()
+
+ set(${COMPILE_ASM_OUTPUT_OBJECTS} ${ASSEMBLED_OBJECTS} PARENT_SCOPE)
+endfunction()
+
function(generate_exports_file)
set(INPUT_LIST ${ARGN})
list(GET INPUT_LIST -1 outputFilename)
PROPERTIES GENERATED TRUE)
endfunction()
-function(add_precompiled_header header cppFile targetSources)
+# target_precompile_header(TARGET targetName HEADER headerName [ADDITIONAL_INCLUDE_DIRECTORIES includeDirs])
+function(target_precompile_header)
+ set(options "")
+ set(oneValueArgs TARGET HEADER)
+ set(multiValueArgs ADDITIONAL_INCLUDE_DIRECTORIES)
+ cmake_parse_arguments(PARSE_ARGV 0 PRECOMPILE_HEADERS "${options}" "${oneValueArgs}" "${multiValueArgs}")
+
+ if ("${PRECOMPILE_HEADERS_TARGET}" STREQUAL "")
+ message(SEND_ERROR "No target supplied to target_precompile_header.")
+ endif()
+ if ("${PRECOMPILE_HEADERS_HEADER}" STREQUAL "")
+ message(SEND_ERROR "No header supplied to target_precompile_header.")
+ endif()
+
if(MSVC)
- set(precompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/stdafx.pch")
-
- set_source_files_properties(${cppFile}
- PROPERTIES COMPILE_FLAGS "/Yc\"${header}\" /Fp\"${precompiledBinary}\""
- OBJECT_OUTPUTS "${precompiledBinary}")
- set_source_files_properties(${${targetSources}}
- PROPERTIES COMPILE_FLAGS "/Yu\"${header}\" /Fp\"${precompiledBinary}\""
- OBJECT_DEPENDS "${precompiledBinary}")
- # Add cppFile to SourcesVar
- set(${targetSources} ${${targetSources}} ${cppFile} PARENT_SCOPE)
+ get_filename_component(PCH_NAME ${PRECOMPILE_HEADERS_HEADER} NAME_WE)
+ # We need to use the $<TARGET_PROPERTY:NAME> generator here instead of the ${targetName} variable since
+ # CMake evaluates source file properties once per directory. If we just use ${targetName}, we end up sharing
+ # the same PCH between targets, which doesn't work.
+ set(precompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PCH_NAME}.$<TARGET_PROPERTY:NAME>.pch")
+ set(pchSourceFile "${CMAKE_CURRENT_BINARY_DIR}/${PCH_NAME}.${PRECOMPILE_HEADERS_TARGET}.cpp")
+
+ file(GENERATE OUTPUT ${pchSourceFile} CONTENT "#include \"${PRECOMPILE_HEADERS_HEADER}\"")
+
+ set(PCH_SOURCE_FILE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} ${PRECOMPILE_HEADERS_ADDITIONAL_INCLUDE_DIRECTORIES})
+
+ set_source_files_properties(${pchSourceFile}
+ PROPERTIES COMPILE_FLAGS "/Yc\"${PRECOMPILE_HEADERS_HEADER}\" /Fp\"${precompiledBinary}\""
+ OBJECT_OUTPUTS "${precompiledBinary}"
+ INCLUDE_DIRECTORIES "${PCH_SOURCE_FILE_INCLUDE_DIRECTORIES}")
+ get_target_property(TARGET_SOURCES ${PRECOMPILE_HEADERS_TARGET} SOURCES)
+
+ foreach (SOURCE ${TARGET_SOURCES})
+ get_source_file_property(SOURCE_LANG ${SOURCE} LANGUAGE)
+ if (("${SOURCE_LANG}" STREQUAL "C") OR ("${SOURCE_LANG}" STREQUAL "CXX"))
+ set_source_files_properties(${SOURCE}
+ PROPERTIES COMPILE_FLAGS "/Yu\"${PRECOMPILE_HEADERS_HEADER}\" /Fp\"${precompiledBinary}\""
+ OBJECT_DEPENDS "${precompiledBinary}")
+ endif()
+ endforeach()
+
+ # Add pchSourceFile to PRECOMPILE_HEADERS_TARGET target
+ target_sources(${PRECOMPILE_HEADERS_TARGET} PRIVATE ${pchSourceFile})
endif(MSVC)
endfunction()
function(strip_symbols targetName outputFilename)
if (CLR_CMAKE_PLATFORM_UNIX)
if (STRIP_SYMBOLS)
-
- # On the older version of cmake (2.8.12) used on Ubuntu 14.04 the TARGET_FILE
- # generator expression doesn't work correctly returning the wrong path and on
- # the newer cmake versions the LOCATION property isn't supported anymore.
- if (CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0)
- set(strip_source_file $<TARGET_FILE:${targetName}>)
- else()
- get_property(strip_source_file TARGET ${targetName} PROPERTY LOCATION)
- endif()
+ set(strip_source_file $<TARGET_FILE:${targetName}>)
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(strip_destination_file ${strip_source_file}.dwarf)
list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX)
if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1)
strip_symbols(${targetName} strip_destination_file)
- # On the older version of cmake (2.8.12) used on Ubuntu 14.04 the TARGET_FILE
- # generator expression doesn't work correctly returning the wrong path and on
- # the newer cmake versions the LOCATION property isn't supported anymore.
- if(CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0)
- set(install_source_file $<TARGET_FILE:${targetName}>)
- else()
- get_property(install_source_file TARGET ${targetName} PROPERTY LOCATION)
- endif()
- install(PROGRAMS ${install_source_file} DESTINATION .)
+ # We don't need to install the export libraries for our DLLs
+ # since they won't be directly linked against.
+ install(PROGRAMS $<TARGET_FILE:${targetName}> DESTINATION .)
if(WIN32)
+ # We can't use the $<TARGET_PDB_FILE> generator expression here since
+ # the generator expression isn't supported on resource DLLs.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pdb DESTINATION PDB)
else()
install(FILES ${strip_destination_file} DESTINATION .)
+include(CheckIPOSupported)
+check_ipo_supported(RESULT HAVE_LTO)
+
# Adds Profile Guided Optimization (PGO) flags to the current target
function(add_pgo TargetName)
if(WIN32)
# variable specified by the TARGET_FILE parameter.
function(build_resources SOURCE TARGET_NAME TARGET_FILE)
- get_compile_definitions(PREPROCESS_DEFINITIONS)
- get_include_directories(INCLUDE_DIRECTORIES)
-
set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)
+
+ preprocess_file(${SOURCE} ${PREPROCESSED_SOURCE})
+
set(RESOURCE_ENTRY_ARRAY_CPP ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.cpp)
add_custom_command(
OUTPUT ${RESOURCE_ENTRY_ARRAY_CPP}
- # Preprocess the windows .rc file
- COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${INCLUDE_DIRECTORIES} -o ${PREPROCESSED_SOURCE} -x c ${SOURCE}
# Convert the preprocessed .rc file to a C++ file which will be used to make a static lib.
COMMAND ${AWK} -v name=${TARGET_NAME} -f ${RC_TO_CPP} -f ${PROCESS_RC} ${PREPROCESSED_SOURCE} >${RESOURCE_ENTRY_ARRAY_CPP}
- DEPENDS ${SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
+ DEPENDS ${PREPROCESSED_SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
)
include_directories(${RESOURCE_STRING_HEADER_DIR})
+++ /dev/null
-# replace backslashes in path with forward slash
-STRING(REGEX REPLACE "\\\\" "/" VSINSTALLDIR $ENV{VSINSTALLDIR} )
-
-# Generate managed type lib from dia2.idl
-add_custom_target(dialib ALL
- # generate tlb file from idl
- COMMAND midl.exe /I"${VSINSTALLDIR}DIA SDK/include" /tlb ${CMAKE_CURRENT_BINARY_DIR}/dia2.tlb /Zp8 "${VSINSTALLDIR}DIA SDK/idl/dia2.idl"
- # run tlbimp to generate managed type library
- COMMAND TlbImp.exe /silent /namespace:Dia /unsafe /strictref:nopia ${CMAKE_CURRENT_BINARY_DIR}/dia2.tlb /out:${CMAKE_CURRENT_BINARY_DIR}/dialib.dll
- COMMENT Generating managed type library from dia2.idl
-)
-
-# In order to use dialib.dll as library target it needs to be imported into cmake
-# Target is used in ToolBox/SOS/dactablegen/cmakelists.txt
-add_library_clr(dialib_dll SHARED IMPORTED GLOBAL)
-set_property(TARGET dialib_dll PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/dialib.dll)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-#define FX_VER_FILEDESCRIPTION_STR "Microsoft\0"
-
-#include <fxver.h>
-#include <fxver.rc>
../superpmi-shared/spmidumphelper.cpp
)
-add_precompiled_header(
- standardpch.h
- ../superpmi-shared/standardpch.cpp
- MCS_SOURCES
-)
-
_add_executable(mcs
${MCS_SOURCES}
)
+target_precompile_header(TARGET mcs HEADER standardpch.h)
if(CLR_CMAKE_PLATFORM_UNIX)
target_link_libraries(mcs
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-// Don't touch this file: it's just here to create a precompiled header...
-#include "standardpch.h"
../superpmi-shared/typeutils.cpp
../superpmi-shared/spmidumphelper.cpp
)
-
-add_precompiled_header(
- standardpch.h
- ../superpmi-shared/standardpch.cpp
- SUPERPMI_SHIM_COLLECTOR_SOURCES
-)
-
if (WIN32)
- preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/superpmi-shim-collector.def ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-collector.def)
+ preprocess_file(${CMAKE_CURRENT_SOURCE_DIR}/superpmi-shim-collector.def ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-collector.def)
list(APPEND SUPERPMI_SHIM_COLLECTOR_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-collector.def)
endif (WIN32)
${SUPERPMI_SHIM_COLLECTOR_SOURCES}
)
+target_precompile_header(TARGET superpmi-shim-collector HEADER standardpch.h)
+
if(CLR_CMAKE_PLATFORM_UNIX)
target_link_libraries(superpmi-shim-collector
utilcodestaticnohost
../superpmi-shared/spmidumphelper.cpp
)
-add_precompiled_header(
- standardpch.h
- ../superpmi-shared/standardpch.cpp
- SUPERPMI_SHIM_COUNTER_SOURCES
-)
-
if (WIN32)
- preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/superpmi-shim-counter.def ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-counter.def)
+ preprocess_file(${CMAKE_CURRENT_SOURCE_DIR}/superpmi-shim-counter.def ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-counter.def)
list(APPEND SUPERPMI_SHIM_COUNTER_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-counter.def)
endif (WIN32)
${SUPERPMI_SHIM_COUNTER_SOURCES}
)
+target_precompile_header(TARGET superpmi-shim-counter HEADER standardpch.h)
+
if(CLR_CMAKE_PLATFORM_UNIX)
target_link_libraries(superpmi-shim-counter
utilcodestaticnohost
../superpmi-shared/spmidumphelper.cpp
)
-add_precompiled_header(
- standardpch.h
- ../superpmi-shared/standardpch.cpp
- SUPERPMI_SHIM_SIMPLE_SOURCES
-)
-
if (WIN32)
- preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/superpmi-shim-simple.def ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-simple.def)
+ preprocess_file(${CMAKE_CURRENT_SOURCE_DIR}/superpmi-shim-simple.def ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-simple.def)
list(APPEND SUPERPMI_SHIM_SIMPLE_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/superpmi-shim-simple.def)
endif (WIN32)
${SUPERPMI_SHIM_SIMPLE_SOURCES}
)
+target_precompile_header(TARGET superpmi-shim-simple HEADER standardpch.h)
+
if(CLR_CMAKE_PLATFORM_UNIX)
target_link_libraries(superpmi-shim-simple
utilcodestaticnohost
../superpmi-shared/spmidumphelper.cpp
)
-add_precompiled_header(
- standardpch.h
- ../superpmi-shared/standardpch.cpp
- SUPERPMI_SOURCES
-)
-
_add_executable(superpmi
${SUPERPMI_SOURCES}
)
+target_precompile_header(TARGET superpmi HEADER standardpch.h)
+
if(CLR_CMAKE_PLATFORM_UNIX)
target_link_libraries(superpmi
utilcodestaticnohost
convert_to_absolute_path(BINDER_SOURCES ${BINDER_SOURCES})
convert_to_absolute_path(BINDER_CROSSGEN_SOURCES ${BINDER_CROSSGEN_SOURCES})
-add_subdirectory(v3binder)
-add_subdirectory(v3binder_crossgen)
+add_library_clr(v3binder
+ STATIC
+ ${BINDER_SOURCES}
+)
+add_dependencies(v3binder eventing_headers)
+
+add_library_clr(v3binder_crossgen
+ STATIC
+ ${BINDER_CROSSGEN_SOURCES}
+)
+add_dependencies(v3binder_crossgen eventing_headers)
+set_target_properties(v3binder_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+
+++ /dev/null
-add_library_clr(v3binder
- STATIC
- ${BINDER_SOURCES}
-)
-
-add_dependencies(v3binder eventing_headers)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-
-add_library_clr(v3binder_crossgen
- STATIC
- ${BINDER_CROSSGEN_SOURCES}
-)
-
-add_dependencies(v3binder_crossgen eventing_headers)
-
-include(${CLR_DIR}/dac.cmake)
-
add_definitions(-DFEATURE_NO_HOST)
include_directories(BEFORE ${VM_DIR})
convert_to_absolute_path(DACCESS_SOURCES ${DACCESS_SOURCES})
-add_precompiled_header(stdafx.h stdafx.cpp DACCESS_SOURCES)
-
add_library_clr(daccess ${DACCESS_SOURCES})
+set_target_properties(daccess PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET daccess HEADER stdafx.h)
add_dependencies(daccess eventing_headers)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// File: stdafx.cpp
-//
-
-//
-// Host for precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h" // Precompiled header key.
if ((CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)
convert_to_absolute_path(CORDBDI_SOURCES_ASM_FILE ${CORDBDI_SOURCES_ASM_FILE})
-
- # Inserts a custom command in CMake build to preprocess each asm source file
- get_filename_component(name ${CORDBDI_SOURCES_ASM_FILE} NAME_WE)
- file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${name}.asm" ASM_PREPROCESSED_FILE)
- preprocess_def_file(${CORDBDI_SOURCES_ASM_FILE} ${ASM_PREPROCESSED_FILE})
-
- # We do not pass any defines since we have already done pre-processing above
- set (ASM_CMDLINE "-o ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj ${ASM_PREPROCESSED_FILE}")
-
- # Generate the batch file that will invoke the assembler
- file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/runasm_${name}.cmd" ASM_SCRIPT_FILE)
-
- file(GENERATE OUTPUT "${ASM_SCRIPT_FILE}"
- CONTENT "\"${CMAKE_ASM_MASM_COMPILER}\" -g ${ASM_CMDLINE}")
-
- message("Generated - ${ASM_SCRIPT_FILE}")
-
- # Need to compile asm file using custom command as include directories are not provided to asm compiler
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj
- COMMAND ${ASM_SCRIPT_FILE}
- DEPENDS ${ASM_PREPROCESSED_FILE}
- COMMENT "Assembling ${ASM_PREPROCESSED_FILE} - ${ASM_SCRIPT_FILE}")
-
- # mark obj as source that does not require compile
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${name}.obj PROPERTIES EXTERNAL_OBJECT TRUE)
-
- # Add the generated OBJ in the dependency list so that it gets consumed during linkage
- set(CORDBDI_SOURCES_ASM_FILE ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj)
+ preprocess_compile_asm(ASM_FILES ${CORDBDI_SOURCES_ASM_FILE} OUTPUT_OBJECTS CORDBDI_SOURCES_ASM_FILE)
endif()
elseif(CLR_CMAKE_PLATFORM_UNIX)
endif(WIN32)
-add_precompiled_header(stdafx.h stdafx.cpp CORDBDI_SOURCES)
-
if (WIN32)
convert_to_absolute_path(CORDBDI_HEADERS ${CORDBDI_HEADERS})
list(APPEND CORDBDI_SOURCES ${CORDBDI_HEADERS})
list(APPEND CORDBDI_SOURCES ${CORDBDI_SOURCES_ASM_FILE})
add_library_clr(cordbdi STATIC ${CORDBDI_SOURCES})
+target_precompile_header(TARGET cordbdi HEADER stdafx.h)
add_dependencies(cordbdi eventing_headers)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Host for precompiled header.
-//
-//*****************************************************************************
-#include "stdafx.h" // Precompiled header key.
-include(${CLR_DIR}/dac.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp CORDBEE_SOURCES_DAC)
-
if (WIN32)
list(APPEND CORDBEE_SOURCES_DAC ${CORDBEE_HEADERS_DAC})
endif (WIN32)
add_library_clr(cordbee_dac ${CORDBEE_SOURCES_DAC})
+set_target_properties(cordbee_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET cordbee_dac HEADER stdafx.h)
add_dependencies(cordbee_dac eventing_headers)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// File: stdafx.cpp
-//
-
-//
-// Host for precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h" // Precompiled header key.
if (WIN32)
- add_precompiled_header(stdafx.h ../stdafx.cpp CORDBEE_SOURCES_WKS)
-
list(APPEND CORDBEE_SOURCES_WKS ${CORDBEE_HEADERS_WKS})
get_include_directories(ASM_INCLUDE_DIRECTORIES)
if(CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
- get_filename_component(name ${ASM_FILE} NAME_WE)
- file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${name}.asm" ASM_PREPROCESSED_FILE)
- preprocess_def_file(${ASM_FILE} ${ASM_PREPROCESSED_FILE})
-
- # We do not pass any defines since we have already done pre-processing above
- set (ASM_CMDLINE "-o ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj ${ASM_PREPROCESSED_FILE}")
-
- # Generate the batch file that will invoke the assembler
- file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/runasm_${name}.cmd" ASM_SCRIPT_FILE)
-
- file(GENERATE OUTPUT "${ASM_SCRIPT_FILE}"
- CONTENT "\"${CMAKE_ASM_MASM_COMPILER}\" -g ${ASM_CMDLINE}")
+ preprocess_compile_asm(ASM_FILES ${ASM_FILE} OUTPUT_OBJECTS ASM_OBJECTS)
- message("Generated - ${ASM_SCRIPT_FILE}")
-
- # Need to compile asm file using custom command as include directories are not provided to asm compiler
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj
- COMMAND ${ASM_SCRIPT_FILE}
- DEPENDS ${ASM_PREPROCESSED_FILE}
- COMMENT "Assembling ${ASM_PREPROCESSED_FILE} - ${ASM_SCRIPT_FILE}")
-
- add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS} ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj)
+ add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS} ${ASM_OBJECTS})
else ()
list (APPEND ASM_OPTIONS /safeseh)
endif (CLR_CMAKE_PLATFORM_ARCH_I386)
- # Need to compile asm file using custom command as include directories are not provided to asm compiler
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj
- COMMAND ${CMAKE_ASM_MASM_COMPILER} ${ASM_INCLUDE_DIRECTORIES} ${ASM_DEFINITIONS} ${ASM_OPTIONS} /Fo${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj /Ta${ASM_FILE}
- DEPENDS ${ASM_FILE}
- COMMENT "Compiling dbghelpers.asm")
-
- add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS} ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj)
+ set_source_files_properties(${ASM_FILE} PROPERTIES COMPILE_OPTIONS "${ASM_OPTIONS}")
+
+ add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS} ${ASM_FILE})
endif()
endif (WIN32)
+target_precompile_header(TARGET cordbee_wks HEADER stdafx.h)
add_dependencies(cordbee_wks eventing_headers)
dbgshim.rc
)
- preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/dbgshim.ntdef ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
+ preprocess_file(${CMAKE_CURRENT_SOURCE_DIR}/dbgshim.ntdef ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
list(APPEND DBGSHIM_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def)
else(WIN32)
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dbgshim_unixexports.src)
-include(${CLR_DIR}/dac.cmake)
add_definitions(-DFEATURE_NO_HOST)
set(CLR_DAC_SOURCES
set(CURRENT_BINARY_DIR_FOR_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
# Preprocess exports definition file
- preprocess_def_file(${CMAKE_CURRENT_SOURCE_DIR}/${DEF_SOURCES} ${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def)
+ preprocess_file(${CMAKE_CURRENT_SOURCE_DIR}/${DEF_SOURCES} ${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def)
# Create target to add file dependency on mscordac.def
add_custom_target(mscordaccore_def DEPENDS ${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def)
add_library_clr(mscordaccore SHARED ${CLR_DAC_SOURCES} $<TARGET_OBJECTS:mscordacobj>)
+set_target_properties(mscordacobj mscordaccore PROPERTIES DAC_COMPONENT TRUE)
+
if(CLR_CMAKE_PLATFORM_LINUX)
add_dependencies(mscordaccore lib_redefines_inc)
endif(CLR_CMAKE_PLATFORM_LINUX)
list(APPEND MSCORDBI_SOURCES ${PAL_REDEFINES_FILE})
endif(CLR_CMAKE_PLATFORM_LINUX)
-if(WIN32)
- add_precompiled_header(stdafx.h stdafx.cpp MSCORDBI_SOURCES)
-
+if(WIN32)
add_definitions(-DFX_VER_INTERNALNAME_STR=mscordbi.dll)
list(APPEND MSCORDBI_SOURCES
convert_to_absolute_path(DEF_SOURCES ${DEF_SOURCES})
- preprocess_def_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
+ preprocess_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
list(APPEND MSCORDBI_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.def)
else(WIN32)
endif(CLR_CMAKE_PLATFORM_DARWIN)
add_library_clr(mscordbi SHARED ${MSCORDBI_SOURCES})
+target_precompile_header(TARGET mscordbi HEADER stdafx.h)
if(CLR_CMAKE_PLATFORM_UNIX)
add_custom_target(mscordbi_exports DEPENDS ${EXPORTS_FILE})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-// Precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h"
if (WIN32)
- preprocess_def_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def)
+ preprocess_file(${DEF_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def)
list(APPEND CLR_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ENTRY:CoreDllMain")
+ add_link_options(/ENTRY:CoreDllMain)
# Incremental linking results in the linker inserting extra padding and routing function calls via thunks that can break the
# invariants (e.g. size of region between Jit_PatchedCodeLast-Jit_PatchCodeStart needs to fit in a page).
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL:NO")
+ add_link_options(/INCREMENTAL:NO)
# Delay load libraries required for WinRT as that is not supported on all platforms
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:api-ms-win-core-winrt-roparameterizediid-l1-1-0.dll")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:api-ms-win-ro-typeresolution-l1-1-0.dll")
+ add_link_options("/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll")
+ add_link_options("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll")
+ add_link_options("/DELAYLOAD:api-ms-win-core-winrt-roparameterizediid-l1-1-0.dll")
+ add_link_options("/DELAYLOAD:api-ms-win-ro-typeresolution-l1-1-0.dll")
# Delay load version.dll so that we can specify how to search when loading it as it is not part of Windows' known DLLs
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:version.dll")
+ add_link_options("/DELAYLOAD:version.dll")
# No library groups for Win32
set(START_LIBRARY_GROUP)
if(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL NetBSD)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Xlinker -Bsymbolic-functions")
+ add_link_options("LINKER:-Bsymbolic,-Bsymbolic-functions")
# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
include(${CMAKE_INSTALL_PREFIX}/${CLR_CMAKE_CROSS_HOST_ARCH}/dactabletools/dactabletools.cmake)
endif()
- set(DACTABLEGEN_EXE $<TARGET_FILE:dactablegen>)
- set(INJECT_RESOURCE_EXE $<TARGET_FILE:InjectResource>)
- set(GEN_CLR_DEBUG_RESOURCE_EXE $<TARGET_FILE:GenClrDebugResource>)
-
add_custom_command(
DEPENDS coreclr mscordaccore mscordbi ${CLR_DIR}/src/debug/daccess/daccess.cpp
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp
COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
- COMMAND ${DACTABLEGEN_EXE} /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
- COMMAND ${INJECT_RESOURCE_EXE} /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
- COMMAND ${GEN_CLR_DEBUG_RESOURCE_EXE} /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
- COMMAND ${INJECT_RESOURCE_EXE} /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
- COMMAND ${INJECT_RESOURCE_EXE} /bin:${CMAKE_CURRENT_SOURCE_DIR}/dump_helper_resource.bin /dll:$<TARGET_FILE:coreclr> /name:MINIDUMP_AUXILIARY_PROVIDER
+ COMMAND dactablegen /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
+ COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
+ COMMAND GenClrDebugResource /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
+ COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
+ COMMAND InjectResource /bin:${CMAKE_CURRENT_SOURCE_DIR}/dump_helper_resource.bin /dll:$<TARGET_FILE:coreclr> /name:MINIDUMP_AUXILIARY_PROVIDER
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp
COMMENT Add dactable, debug resources, and dump helper resources to coreclr
)
convert_to_absolute_path(GCINFO_SOURCES ${GCINFO_SOURCES})
-add_subdirectory(lib)
-add_subdirectory(crossgen)
+add_library_clr(gcinfo
+ STATIC
+ ${GCINFO_SOURCES}
+)
+
+add_library_clr(gcinfo_crossgen
+ STATIC
+ ${GCINFO_SOURCES}
+)
+
+set_target_properties(gcinfo_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+
if (CLR_CMAKE_PLATFORM_ARCH_I386)
# On x86, build RyuJIT/ARM32 cross-compiling altjit.
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-
-add_library_clr(gcinfo_crossgen
- STATIC
- ${GCINFO_SOURCES}
-)
+++ /dev/null
-add_library_clr(gcinfo
- STATIC
- ${GCINFO_SOURCES}
-)
if(WIN32)
- add_precompiled_header(jitpch.h ../jitpch.cpp SOURCES)
set(CLRJIT_EXPORTS ${CMAKE_CURRENT_LIST_DIR}/ClrJit.exports)
set(JIT_EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/ClrJit.exports.def)
- preprocess_def_file (${CLRJIT_EXPORTS} ${JIT_EXPORTS_FILE})
+ preprocess_file (${CLRJIT_EXPORTS} ${JIT_EXPORTS_FILE})
set(SHARED_LIB_SOURCES ${SOURCES} ${JIT_EXPORTS_FILE})
else()
)
endif(CLR_CMAKE_PLATFORM_UNIX)
+set(JIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
if (FEATURE_MERGE_JIT_AND_ENGINE)
# Despite the directory being named "dll", it creates a static library "clrjit_static" to link into the VM.
add_subdirectory(dll)
${JIT_ARCH_ALTJIT_SOURCES}
)
+target_precompile_header(TARGET armelnonjit HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
+
add_dependencies(armelnonjit jit_exports)
set_property(TARGET armelnonjit APPEND_STRING PROPERTY LINK_FLAGS ${JIT_EXPORTS_LINKER_OPTION})
-include(${CLR_DIR}/crossgen.cmake)
-
add_library_clr(clrjit_crossgen ${SOURCES} ${JIT_ARCH_SOURCES})
if(FEATURE_MERGE_JIT_AND_ENGINE)
target_link_libraries(clrjit_crossgen ${RYUJIT_LINK_LIBRARIES})
endif(FEATURE_MERGE_JIT_AND_ENGINE)
+set_target_properties(clrjit_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET clrjit_crossgen HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
${JIT_ARCH_SOURCES}
)
endif(CLR_CMAKE_PLATFORM_UNIX)
+target_precompile_header(TARGET clrjit_static HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-/*****************************************************************************/
-
-#include "jitpch.h"
${SHARED_LIB_SOURCES}
${JIT_ARCH_ALTJIT_SOURCES}
)
+target_precompile_header(TARGET linuxnonjit HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
add_dependencies(linuxnonjit jit_exports)
${JIT_ARCH_SOURCES}
)
+target_precompile_header(TARGET protojit HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
+
add_dependencies(protojit jit_exports)
set_property(TARGET protojit APPEND_STRING PROPERTY LINK_FLAGS ${JIT_EXPORTS_LINKER_OPTION})
${JIT_ARCH_ALTJIT_SOURCES}
)
+target_precompile_header(TARGET protononjit HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
+
add_dependencies(protononjit jit_exports)
set_property(TARGET protononjit APPEND_STRING PROPERTY LINK_FLAGS ${JIT_EXPORTS_LINKER_OPTION})
${JIT_ARCH_SOURCES}
)
+target_precompile_header(TARGET clrjit HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR})
+
add_dependencies(clrjit jit_exports)
set_property(TARGET clrjit APPEND_STRING PROPERTY LINK_FLAGS ${JIT_EXPORTS_LINKER_OPTION})
+
+add_compile_definitions(FEATURE_METADATA_EMIT)
+add_compile_definitions(FEATURE_METADATA_INTERNAL_APIS)
+add_compile_definitions($<$<OR:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>,$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>>:FEATURE_METADATA_EMIT_IN_DEBUGGER>)
+add_compile_definitions($<$<NOT:$<OR:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>,$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>>>:FEATURE_METADATA_IN_VM>)
+add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_CUSTOM_DATA_SOURCE>)
+add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_DEBUGGEE_DATA_SOURCE>)
+add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_LOAD_TRUSTED_IMAGES>)
+add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_RELEASE_MEMORY_ON_REOPEN>)
+
+if (WIN32)
+ add_compile_options($<$<AND:$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>,$<CONFIG:DEBUG>>:-MTd>)
+ add_compile_options($<$<AND:$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>,$<NOT:$<CONFIG:DEBUG>>>:-MT>)
+ add_compile_definitions($<$<NOT:$<OR:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>,$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>>>:FEATURE_METADATA_VERIFY_LAYOUTS>)
+endif()
+
add_subdirectory(compiler)
add_subdirectory(runtime)
add_subdirectory(enc)
add_subdirectory(datasource)
add_subdirectory(staticmd)
if(WIN32)
-add_subdirectory(winmd)
+ add_subdirectory(winmd)
endif(WIN32)
../../inc/utilcode.h
)
-add_precompiled_header(stdafx.h stdafx.cpp CEEFILEGEN_SOURCES)
-
if (WIN32)
list(APPEND CEEFILEGEN_SOURCES ${CEEFILEGEN_HEADERS})
endif (WIN32)
STATIC
${CEEFILEGEN_SOURCES}
)
+target_precompile_header(TARGET ceefgen HEADER stdafx.h)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Host for precompiled header.
-//
-//*****************************************************************************
-#include "stdafx.h" // Precompiled header key.
convert_to_absolute_path(MDCOMPILER_SOURCES ${MDCOMPILER_SOURCES})
convert_to_absolute_path(MDCOMPILER_HEADERS ${MDCOMPILER_HEADERS})
-add_subdirectory(dac)
-add_subdirectory(wks)
-add_subdirectory(dbi)
-add_subdirectory(crossgen)
+if (WIN32)
+ list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS})
+endif()
+
+add_library_clr(mdcompiler_dac ${MDCOMPILER_SOURCES})
+set_target_properties(mdcompiler_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET mdcompiler_dac HEADER stdafx.h)
+
+add_library_clr(mdcompiler_wks ${MDCOMPILER_SOURCES})
+target_compile_definitions(mdcompiler_wks PRIVATE FEATURE_METADATA_EMIT_ALL)
+target_precompile_header(TARGET mdcompiler_wks HEADER stdafx.h)
+
+add_library_clr(mdcompiler-dbi ${MDCOMPILER_SOURCES})
+set_target_properties(mdcompiler-dbi PROPERTIES DBI_COMPONENT TRUE)
+target_precompile_header(TARGET mdcompiler-dbi HEADER stdafx.h)
+
+add_library_clr(mdcompiler_crossgen ${MDCOMPILER_SOURCES})
+set_target_properties(mdcompiler_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET mdcompiler_crossgen HEADER stdafx.h)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-include(../../md_wks.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDCOMPILER_SOURCES)
-
-if (WIN32)
- list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdcompiler_crossgen ${MDCOMPILER_SOURCES})
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-include(../../md_dac.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDCOMPILER_SOURCES)
-
-if (WIN32)
- list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdcompiler_dac ${MDCOMPILER_SOURCES})
+++ /dev/null
-include(../../md_dbi.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDCOMPILER_SOURCES)
-
-if (WIN32)
- list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdcompiler-dbi ${MDCOMPILER_SOURCES})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h"
+++ /dev/null
-include(../../md_wks.cmake)
-
-add_definitions(-DFEATURE_METADATA_EMIT_ALL)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDCOMPILER_SOURCES)
-
-if (WIN32)
- list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdcompiler_wks ${MDCOMPILER_SOURCES})
convert_to_absolute_path(MDDATASOURCE_SOURCES ${MDDATASOURCE_SOURCES})
convert_to_absolute_path(MDDATASOURCE_HEADERS ${MDDATASOURCE_HEADERS})
-add_subdirectory(dbi)
+if (WIN32)
+ list(APPEND MDDATASOURCE_SOURCES ${MDDATASOURCE_HEADERS})
+endif (WIN32)
+
+add_library_clr(mddatasource_dbi STATIC ${MDDATASOURCE_SOURCES})
+set_target_properties(mddatasource_dbi PROPERTIES DBI_COMPONENT TRUE)
+target_precompile_header(TARGET mddatasource_dbi HEADER stdafx.h)
+++ /dev/null
-include(../../md_dbi.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDDATASOURCE_SOURCES)
-
-if (WIN32)
- list(APPEND MDDATASOURCE_SOURCES ${MDDATASOURCE_HEADERS})
-endif (WIN32)
-
-add_library_clr(mddatasource_dbi STATIC ${MDDATASOURCE_SOURCES})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h"
convert_to_absolute_path(MDRUNTIMERW_HEADERS ${MDRUNTIMERW_HEADERS})
convert_to_absolute_path(MDRUNTIMERW_SOURCES ${MDRUNTIMERW_SOURCES})
-add_subdirectory(dac)
-add_subdirectory(wks)
-add_subdirectory(dbi)
-add_subdirectory(crossgen)
+add_library_clr(mdruntimerw_dac ${MDRUNTIMERW_SOURCES})
+set_target_properties(mdruntimerw_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET mdruntimerw_dac HEADER stdafx.h)
+
+add_library_clr(mdruntimerw_wks ${MDRUNTIMERW_SOURCES})
+target_compile_definitions(mdruntimerw_wks PRIVATE FEATURE_METADATA_EMIT_ALL)
+target_precompile_header(TARGET mdruntimerw_wks HEADER stdafx.h)
+
+add_library_clr(mdruntimerw-dbi ${MDRUNTIMERW_SOURCES})
+set_target_properties(mdruntimerw-dbi PROPERTIES DBI_COMPONENT TRUE)
+target_precompile_header(TARGET mdruntimerw-dbi HEADER stdafx.h)
+
+add_library_clr(mdruntimerw_crossgen ${MDRUNTIMERW_SOURCES})
+set_target_properties(mdruntimerw_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET mdruntimerw_crossgen HEADER stdafx.h)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-include(../../md_wks.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIMERW_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIMERW_SOURCES ${MDRUNTIMERW_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntimerw_crossgen ${MDRUNTIMERW_SOURCES})
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-include(../../md_dac.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIMERW_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIMERW_SOURCES ${MDRUNTIMERW_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntimerw_dac ${MDRUNTIMERW_SOURCES})
+++ /dev/null
-include(../../md_dbi.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIMERW_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIMERW_SOURCES ${MDRUNTIMERW_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntimerw-dbi ${MDRUNTIMERW_SOURCES})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h"
+++ /dev/null
-include(../../md_wks.cmake)
-
-add_definitions(-DFEATURE_METADATA_EMIT_ALL)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIMERW_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIMERW_SOURCES ${MDRUNTIMERW_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntimerw_wks ${MDRUNTIMERW_SOURCES})
convert_to_absolute_path(MDHOTDATA_HEADERS ${MDHOTDATA_HEADERS})
convert_to_absolute_path(MDHOTDATA_SOURCES ${MDHOTDATA_SOURCES})
-add_subdirectory(dac)
-add_subdirectory(full)
-add_subdirectory(crossgen)
+if (WIN32)
+ list(APPEND MDHOTDATA_SOURCES ${MDHOTDATA_HEADERS})
+endif (WIN32)
+
+add_library_clr(mdhotdata_dac ${MDHOTDATA_SOURCES})
+set_target_properties(mdhotdata_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET mdhotdata_dac HEADER external.h)
+
+add_library_clr(mdhotdata_full ${MDHOTDATA_SOURCES})
+target_precompile_header(TARGET mdhotdata_full HEADER external.h)
+
+add_library_clr(mdhotdata_crossgen ${MDHOTDATA_SOURCES})
+set_target_properties(mdhotdata_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET mdhotdata_crossgen HEADER external.h)
+
if(WIN32)
- add_subdirectory(full-staticcrt)
+ add_library_clr(mdhotdata-staticcrt ${MDHOTDATA_SOURCES})
+ target_precompile_header(TARGET mdhotdata-staticcrt HEADER external.h)
endif(WIN32)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-include(../../md_wks.cmake)
-
-add_precompiled_header(external.h ../external.cpp MDHOTDATA_SOURCES)
-
-if (WIN32)
- list(APPEND MDHOTDATA_SOURCES ${MDHOTDATA_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdhotdata_crossgen ${MDHOTDATA_SOURCES})
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-
-add_precompiled_header(external.h ../external.cpp MDHOTDATA_SOURCES)
-
-if (WIN32)
- list(APPEND MDHOTDATA_SOURCES ${MDHOTDATA_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdhotdata_dac ${MDHOTDATA_SOURCES})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//
-// File: external.cpp
-//
-
-//
-// Precompiled headers.
-//
-// ======================================================================================
-
-#include "external.h"
+++ /dev/null
-add_definitions(-D_CRTIMP=) # static link of crt
-
-add_precompiled_header(external.h ../external.cpp MDHOTDATA_SOURCES)
-
-if (WIN32)
- list(APPEND MDHOTDATA_SOURCES ${MDHOTDATA_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdhotdata-staticcrt ${MDHOTDATA_SOURCES})
+++ /dev/null
-add_precompiled_header(external.h ../external.cpp MDHOTDATA_SOURCES)
-
-if (WIN32)
- list(APPEND MDHOTDATA_SOURCES ${MDHOTDATA_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdhotdata_full ${MDHOTDATA_SOURCES})
+++ /dev/null
-add_definitions(-DFEATURE_METADATA_EMIT)
-add_definitions(-DFEATURE_METADATA_INTERNAL_APIS)
-add_definitions(-DFEATURE_METADATA_EMIT_IN_DEBUGGER)
\ No newline at end of file
+++ /dev/null
-add_definitions(-DFEATURE_METADATA_EMIT)
-add_definitions(-DFEATURE_METADATA_EMIT_IN_DEBUGGER)
-add_definitions(-DFEATURE_METADATA_INTERNAL_APIS)
-add_definitions(-DFEATURE_METADATA_CUSTOM_DATA_SOURCE)
-add_definitions(-DFEATURE_METADATA_DEBUGGEE_DATA_SOURCE)
-# Enable mscordbi-only (perf) feature -->
-add_definitions(-DFEATURE_METADATA_LOAD_TRUSTED_IMAGES -DFEATURE_METADATA_RELEASE_MEMORY_ON_REOPEN)
-
-
-if(WIN32)
- # using static crt for dbi
- if (CMAKE_BUILD_TYPE STREQUAL DEBUG)
- add_definitions(-MTd)
- else()
- add_definitions(-MT)
- endif(CMAKE_BUILD_TYPE STREQUAL DEBUG)
-endif(WIN32)
+++ /dev/null
-add_definitions(-DFEATURE_METADATA_EMIT)
-add_definitions(-DFEATURE_METADATA_INTERNAL_APIS)
-add_definitions(-DFEATURE_METADATA_IN_VM)
-if(WIN32)
- add_definitions(-DFEATURE_METADATA_VERIFY_LAYOUTS)
-endif(WIN32)
convert_to_absolute_path(MDRUNTIME_HEADERS ${MDRUNTIME_HEADERS})
convert_to_absolute_path(MDRUNTIME_SOURCES ${MDRUNTIME_SOURCES})
-add_subdirectory(dac)
-add_subdirectory(wks)
-add_subdirectory(dbi)
-add_subdirectory(crossgen)
+if (WIN32)
+ list(APPEND MDRUNTIME_SOURCES ${MDRUNTIME_HEADERS})
+endif (WIN32)
+
+add_library_clr(mdruntime_dac ${MDRUNTIME_SOURCES})
+set_target_properties(mdruntime_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET mdruntime_dac HEADER stdafx.h)
+
+add_library_clr(mdruntime_wks ${MDRUNTIME_SOURCES})
+target_compile_definitions(mdruntime_wks PRIVATE FEATURE_METADATA_EMIT_ALL)
+target_precompile_header(TARGET mdruntime_wks HEADER stdafx.h)
+
+add_library_clr(mdruntime-dbi ${MDRUNTIME_SOURCES})
+set_target_properties(mdruntime-dbi PROPERTIES DBI_COMPONENT TRUE)
+target_precompile_header(TARGET mdruntime-dbi HEADER stdafx.h)
+
+add_library_clr(mdruntime_crossgen ${MDRUNTIME_SOURCES})
+set_target_properties(mdruntime_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET mdruntime_crossgen HEADER stdafx.h)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-include(../../md_wks.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIME_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIME_SOURCES ${MDRUNTIME_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntime_crossgen ${MDRUNTIME_SOURCES})
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-include(../../md_dac.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIME_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIME_SOURCES ${MDRUNTIME_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntime_dac ${MDRUNTIME_SOURCES})
\ No newline at end of file
+++ /dev/null
-include(../../md_dbi.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIME_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIME_SOURCES ${MDRUNTIME_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntime-dbi ${MDRUNTIME_SOURCES})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Precompiled headers.
-//
-//*****************************************************************************
-#include "stdafx.h"
+++ /dev/null
-include(../../md_wks.cmake)
-
-add_definitions(-DFEATURE_METADATA_EMIT_ALL)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDRUNTIME_SOURCES)
-
-if (WIN32)
- list(APPEND MDRUNTIME_SOURCES ${MDRUNTIME_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdruntime_wks ${MDRUNTIME_SOURCES})
convert_to_absolute_path(MDWINMD_HEADERS ${MDWINMD_HEADERS})
convert_to_absolute_path(MDWINMD_SOURCES ${MDWINMD_SOURCES})
-add_subdirectory(dac)
-add_subdirectory(wks)
+if (WIN32)
+ list(APPEND MDWINMD_SOURCES ${MDWINMD_HEADERS})
+endif (WIN32)
+
+
+add_library_clr(mdwinmd_dac ${MDWINMD_SOURCES})
+set_target_properties(mdwinmd_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET mdwinmd_dac HEADER stdafx.h)
+
+add_library_clr(mdwinmd_wks ${MDWINMD_SOURCES})
+target_compile_definitions(mdwinmd_wks PRIVATE FEATURE_METADATA_EMIT_ALL)
+target_precompile_header(TARGET mdwinmd_wks HEADER stdafx.h)
+
if(WIN32)
- add_subdirectory(dbi)
- add_subdirectory(crossgen)
+ add_library_clr(mdwinmd_dbi ${MDWINMD_SOURCES})
+ set_target_properties(mdwinmd_dbi PROPERTIES DBI_COMPONENT TRUE)
+ target_precompile_header(TARGET mdwinmd_dbi HEADER stdafx.h)
+
+ add_library_clr(mdwinmd_crossgen ${MDWINMD_SOURCES})
+ set_target_properties(mdwinmd_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+ target_precompile_header(TARGET mdwinmd_crossgen HEADER stdafx.h)
endif(WIN32)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-include(../../md_wks.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDWINMD_SOURCES)
-
-if (WIN32)
- list(APPEND MDWINMD_SOURCES ${MDWINMD_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdwinmd_crossgen ${MDWINMD_SOURCES})
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-include(../../md_dbi.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDWINMD_SOURCES)
-
-if (WIN32)
- list(APPEND MDWINMD_SOURCES ${MDWINMD_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdwinmd_dac ${MDWINMD_SOURCES})
+++ /dev/null
-include(../../md_dbi.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDWINMD_SOURCES)
-
-if (WIN32)
- list(APPEND MDWINMD_SOURCES ${MDWINMD_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdwinmd_dbi ${MDWINMD_SOURCES})
+++ /dev/null
-include(../../md_wks.cmake)
-
-add_definitions(-DFEATURE_METADATA_EMIT_ALL)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp MDWINMD_SOURCES)
-
-if (WIN32)
- list(APPEND MDWINMD_SOURCES ${MDWINMD_HEADERS})
-endif (WIN32)
-
-add_library_clr(mdwinmd_wks ${MDWINMD_SOURCES})
set(MACOSX_RPATH ON)
endif(CORECLR_SET_RPATH)
-if(CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0)
- cmake_policy(SET CMP0042 NEW)
-endif()
+cmake_policy(SET CMP0042 NEW)
# Include directories
cmake_minimum_required(VERSION 2.8.12)
-include(FindPythonInterp)
+include(FindPython)
set (GENERATE_SCRIPT ${CLR_DIR}/src/scripts/genDummyProvider.py)
-set(GENERATE_COMMAND ${PYTHON_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR})
+set(GENERATE_COMMAND ${Python_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR})
execute_process(
COMMAND ${GENERATE_COMMAND} --dry-run
cmake_minimum_required(VERSION 2.8.12)
-include(FindPythonInterp)
+include(FindPython)
set (GENERATE_SCRIPT ${CLR_DIR}/src/scripts/genLttngProvider.py)
-set(GENERATE_COMMAND ${PYTHON_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR})
+set(GENERATE_COMMAND ${Python_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR})
execute_process(
COMMAND ${GENERATE_COMMAND} --dry-run
set(EVENT_MANIFEST ${VM_DIR}/ClrEtwAll.man)
set(TEST_GENERATOR ${CLR_DIR}/src/scripts/genEventingTests.py)
-include(FindPythonInterp)
+include(FindPython)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clralltestevents.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${TEST_GENERATOR} --testdir "${CMAKE_CURRENT_BINARY_DIR}" --man "${EVENT_MANIFEST}"
+ COMMAND ${Python_EXECUTABLE} ${TEST_GENERATOR} --testdir "${CMAKE_CURRENT_BINARY_DIR}" --man "${EVENT_MANIFEST}"
DEPENDS ${EVENT_MANIFEST} ${TEST_GENERATOR}
COMMENT "Updating clralltestevents.cpp"
)
fi
cmake_extra_defines=
-if [[ -n "$LLDB_LIB_DIR" ]]; then
- cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_LIBS=$LLDB_LIB_DIR"
-fi
-if [[ -n "$LLDB_INCLUDE_DIR" ]]; then
- cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_INCLUDES=$LLDB_INCLUDE_DIR"
-fi
if [ "$CROSSCOMPILE" == "1" ]; then
if ! [[ -n "$ROOTFS_DIR" ]]; then
echo "ROOTFS_DIR not set for crosscompile"
"-DCMAKE_BUILD_TYPE=$buildtype" \
"-DCLR_CMAKE_ENABLE_CODE_COVERAGE=$code_coverage" \
"-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \
- "-DCLR_CMAKE_COMPILER=Clang" \
"-DCMAKE_USER_MAKE_RULES_OVERRIDE=" \
$cmake_extra_defines \
$__UnprocessedCMakeArgs \
if ! gcc_ranlib="$(locate_gcc_exec ranlib)"; then { echo "Unable to locate gcc-ranlib"; exit 1; } fi
cmake_extra_defines=
-if [ -n "$LLDB_LIB_DIR" ]; then
- cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_LIBS=$LLDB_LIB_DIR"
-fi
-if [ -n "$LLDB_INCLUDE_DIR" ]; then
- cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_INCLUDES=$LLDB_INCLUDE_DIR"
-fi
if [ "$CROSSCOMPILE" = "1" ]; then
if [ -z "$ROOTFS_DIR" ]; then
echo "ROOTFS_DIR not set for crosscompile"
"-DCMAKE_OBJDUMP=$gcc_objdump" \
"-DCMAKE_BUILD_TYPE=$buildtype" \
"-DCLR_CMAKE_ENABLE_CODE_COVERAGE=$code_coverage" \
- "-DCLR_CMAKE_COMPILER=GNU" \
"-DCMAKE_USER_MAKE_RULES_OVERRIDE=" \
"-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \
$cmake_extra_defines \
include_directories(${VM_DIR}/${ARCH_SOURCES_DIR})
include_directories(${CLR_DIR}/src/md/compiler)
-add_definitions(-DSTRONGNAME_IN_VM -DSNAPI_INTERNAL)
+add_definitions(-DSNAPI_INTERNAL)
set(STRONGNAME_SOURCES
strongname.cpp
convert_to_absolute_path(STRONGNAME_SOURCES ${STRONGNAME_SOURCES})
-add_subdirectory(dac)
-add_subdirectory(wks)
-add_subdirectory(crossgen)
-add_subdirectory(tool)
+add_library_clr(strongname_tool ${STRONGNAME_SOURCES})
+
+add_library_clr(strongname_dac ${STRONGNAME_SOURCES})
+add_dependencies(strongname_dac eventing_headers)
+set_target_properties(strongname_dac PROPERTIES DAC_COMPONENT TRUE)
+target_compile_definitions(strongname_dac PRIVATE STRONGNAME_IN_VM)
+
+add_library_clr(strongname_wks ${STRONGNAME_SOURCES})
+add_dependencies(strongname_wks eventing_headers)
+target_compile_definitions(strongname_wks PRIVATE STRONGNAME_IN_VM)
+
+add_library_clr(strongname_crossgen ${STRONGNAME_SOURCES})
+add_dependencies(strongname_crossgen eventing_headers)
+set_target_properties(strongname_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_compile_definitions(strongname_crossgen PRIVATE STRONGNAME_IN_VM)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-
-add_library_clr(strongname_crossgen ${STRONGNAME_SOURCES})
-add_dependencies(strongname_crossgen eventing_headers)
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-
-add_library_clr(strongname_dac ${STRONGNAME_SOURCES})
-add_dependencies(strongname_dac eventing_headers)
+++ /dev/null
-remove_definitions(-DSTRONGNAME_IN_VM)
-add_library_clr(strongname_tool ${STRONGNAME_SOURCES})
\ No newline at end of file
+++ /dev/null
-add_library_clr(strongname_wks ${STRONGNAME_SOURCES})
-add_dependencies(strongname_wks eventing_headers)
project(crossgen)
-include(${CLR_DIR}/crossgen.cmake)
-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(../util)
include_directories(../../pal/prebuilt/corerror)
${crossgen_SOURCES}
${crossgen_RESOURCES}
)
+set_target_properties(crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
if(FEATURE_MERGE_JIT_AND_ENGINE)
set(CLRJIT_CROSSGEN clrjit_crossgen)
endif(CLR_CMAKE_PLATFORM_UNIX)
-add_subdirectory(../../zap/crossgen ../../zap/crossgen)
+add_subdirectory(../../zap ../../zap)
add_subdirectory(../../vm/crossgen ../../vm/crossgen)
-add_subdirectory(../../vm/crossgen_mscorlib ../../vm/crossgen_mscorlib)
# add the install targets
install_clr(crossgen)
convert_to_absolute_path(UNWINDER_SOURCES ${UNWINDER_SOURCES})
if(CLR_CMAKE_PLATFORM_UNIX)
- add_subdirectory(wks)
+ add_library_clr(unwinder_wks ${UNWINDER_SOURCES})
+ add_dependencies(unwinder_wks eventing_headers)
endif(CLR_CMAKE_PLATFORM_UNIX)
-add_subdirectory(dac)
+add_library_clr(unwinder_dac ${UNWINDER_SOURCES})
+add_dependencies(unwinder_dac eventing_headers)
+set_target_properties(unwinder_dac PROPERTIES DAC_COMPONENT TRUE)
+target_compile_definitions(unwinder_dac PRIVATE FEATURE_NO_HOST)
+
+add_library_clr(unwinder_dac_amd64 ${UNWINDER_SOURCES})
+add_dependencies(unwinder_dac_amd64 eventing_headers)
+set_target_properties(unwinder_dac_amd64 PROPERTIES DAC_COMPONENT TRUE)
+target_compile_definitions(unwinder_dac_amd64 PRIVATE FEATURE_NO_HOST)
+
+++ /dev/null
-include(${CLR_DIR}/dac.cmake)
-
-add_definitions(-DFEATURE_NO_HOST)
-
-add_library_clr(unwinder_dac ${UNWINDER_SOURCES})
-add_dependencies(unwinder_dac eventing_headers)
+++ /dev/null
-include(${CLR_DIR}/dac.cmake)
-
-add_library_clr(unwinder_dac_amd64 ${UNWINDER_SOURCES})
+++ /dev/null
-add_library_clr(unwinder_wks ${UNWINDER_SOURCES})
-add_dependencies(unwinder_wks eventing_headers)
convert_to_absolute_path(UTILCODE_CROSSGEN_SOURCES ${UTILCODE_CROSSGEN_SOURCES})
convert_to_absolute_path(UTILCODE_STATICNOHOST_SOURCES ${UTILCODE_STATICNOHOST_SOURCES})
-add_subdirectory(dac)
-add_subdirectory(dyncrt)
-add_subdirectory(staticnohost)
-add_subdirectory(crossgen)
+add_library_clr(utilcode_dac STATIC ${UTILCODE_DAC_SOURCES})
+add_library_clr(utilcode STATIC ${UTILCODE_SOURCES})
+add_library_clr(utilcodestaticnohost STATIC ${UTILCODE_STATICNOHOST_SOURCES})
+add_library_clr(utilcode_crossgen STATIC ${UTILCODE_CROSSGEN_SOURCES})
+
+if(CLR_CMAKE_PLATFORM_UNIX)
+ target_link_libraries(utilcodestaticnohost nativeresourcestring)
+ target_link_libraries(utilcode_crossgen nativeresourcestring)
+ target_link_libraries(utilcode_dac nativeresourcestring)
+ target_link_libraries(utilcode nativeresourcestring)
+ add_dependencies(utilcode_dac coreclrpal)
+ add_dependencies(utilcode coreclrpal)
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
+
+if(WIN32)
+ target_compile_definitions(utilcodestaticnohost PRIVATE _CRTIMP=) # use static version of crt
+endif(WIN32)
+
+set_target_properties(utilcode_dac PROPERTIES DAC_COMPONENT TRUE)
+set_target_properties(utilcode_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_compile_definitions(utilcode_dac PRIVATE SELF_NO_HOST)
+target_compile_definitions(utilcodestaticnohost PRIVATE SELF_NO_HOST)
+add_dependencies(utilcode_dac ${UTILCODE_DEPENDENCIES})
+add_dependencies(utilcode ${UTILCODE_DEPENDENCIES})
+add_dependencies(utilcode_crossgen ${UTILCODE_DEPENDENCIES})
+add_dependencies(utilcodestaticnohost ${UTILCODE_DEPENDENCIES})
+target_precompile_header(TARGET utilcode_dac HEADER stdafx.h)
+target_precompile_header(TARGET utilcode HEADER stdafx.h)
+target_precompile_header(TARGET utilcode_crossgen HEADER stdafx.h)
+target_precompile_header(TARGET utilcodestaticnohost HEADER stdafx.h)
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-
-add_precompiled_header(stdafx.h ../stdafx.cpp UTILCODE_CROSSGEN_SOURCES)
-add_library_clr(utilcode_crossgen STATIC ${UTILCODE_CROSSGEN_SOURCES})
-if(CLR_CMAKE_PLATFORM_UNIX)
- target_link_libraries(utilcode_crossgen nativeresourcestring)
-endif(CLR_CMAKE_PLATFORM_UNIX)
-
-add_dependencies(utilcode_crossgen ${UTILCODE_DEPENDENCIES})
+++ /dev/null
-include(${CLR_DIR}/dac.cmake)
-
-add_definitions(-DSELF_NO_HOST)
-
-if(CLR_CMAKE_PLATFORM_UNIX)
- add_library_clr(utilcode_dac STATIC ${UTILCODE_DAC_SOURCES})
- target_link_libraries(utilcode_dac nativeresourcestring)
- add_dependencies(utilcode_dac coreclrpal)
-else()
- add_precompiled_header(stdafx.h ../stdafx.cpp UTILCODE_DAC_SOURCES)
- add_library_clr(utilcode_dac STATIC ${UTILCODE_DAC_SOURCES})
-endif(CLR_CMAKE_PLATFORM_UNIX)
-
-add_dependencies(utilcode_dac ${UTILCODE_DEPENDENCIES})
+++ /dev/null
-
-if(CLR_CMAKE_PLATFORM_UNIX)
- add_library_clr(utilcode STATIC ${UTILCODE_SOURCES})
- target_link_libraries(utilcode nativeresourcestring)
- add_dependencies(utilcode coreclrpal)
-else()
- add_precompiled_header(stdafx.h ../stdafx.cpp UTILCODE_SOURCES)
- add_library_clr(utilcode STATIC ${UTILCODE_SOURCES})
-endif(CLR_CMAKE_PLATFORM_UNIX)
-
-add_dependencies(utilcode ${UTILCODE_DEPENDENCIES})
+++ /dev/null
-add_definitions(-DSELF_NO_HOST)
-
-if(WIN32)
- add_definitions(-D_CRTIMP=) # use static version of crt
- add_precompiled_header(stdafx.h ../stdafx.cpp UTILCODE_STATICNOHOST_SOURCES)
-endif(WIN32)
-
-add_library_clr(utilcodestaticnohost STATIC ${UTILCODE_STATICNOHOST_SOURCES})
-
-if(CLR_CMAKE_PLATFORM_UNIX)
- target_link_libraries(utilcodestaticnohost nativeresourcestring)
-endif(CLR_CMAKE_PLATFORM_UNIX)
-
-add_dependencies(utilcodestaticnohost ${UTILCODE_DEPENDENCIES})
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// stdafx.cpp
-//
-
-//
-// Host for precompiled header.
-//
-//*****************************************************************************
-#include "stdafx.h" // Precompiled header key.
convert_to_absolute_path(VM_SOURCES_WKS_ARCH_ASM ${VM_SOURCES_WKS_ARCH_ASM})
convert_to_absolute_path(VM_SOURCES_DAC ${VM_SOURCES_DAC})
-add_subdirectory(dac)
+add_library_clr(cee_dac ${VM_SOURCES_DAC})
+add_dependencies(cee_dac eventing_headers)
+set_target_properties(cee_dac PROPERTIES DAC_COMPONENT TRUE)
+target_precompile_header(TARGET cee_dac HEADER common.h)
+
add_subdirectory(wks)
if(FEATURE_PERFTRACING)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-#include "common.h"
-
-include(${CLR_DIR}/crossgen.cmake)
-
set(VM_CROSSGEN_SOURCES
../appdomain.cpp
../array.cpp
../winrttypenameconverter.h
)
- add_precompiled_header(common.h ../common.cpp VM_CROSSGEN_SOURCES)
- # mscorlib.cpp does not compile with precompiled header file
- set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
list(APPEND VM_CROSSGEN_SOURCES ${VM_CROSSGEN_HEADERS})
endif (WIN32)
add_library_clr(cee_crossgen ${VM_CROSSGEN_SOURCES})
add_dependencies(cee_crossgen eventing_headers)
+set_target_properties(cee_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET cee_crossgen HEADER common.h)
+if (MSVC)
+ # mscorlib.cpp does not compile with precompiled header file
+ set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
+endif()
+
+add_library_clr(mscorlib_crossgen ../mscorlib.cpp)
+add_dependencies(mscorlib_crossgen eventing_headers)
+target_compile_definitions(mscorlib_crossgen
+ PRIVATE
+ EnC_SUPPORTED
+ FEATURE_EVENT_TRACE
+ FEATURE_MULTICOREJIT
+ FEATURE_VERSIONING_LOG
+ CROSSGEN_MSCORLIB)
+
+set_target_properties(mscorlib_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-
-# Add back some of the macro removed by crossgen.cmake.
-add_definitions(
- -DEnC_SUPPORTED
- -DFEATURE_EVENT_TRACE
- -DFEATURE_MULTICOREJIT
- -DFEATURE_VERSIONING_LOG
-)
-
-add_definitions(-DCROSSGEN_MSCORLIB)
-
-add_library_clr(mscorlib_crossgen ../mscorlib.cpp)
-add_dependencies(cee_crossgen eventing_headers)
+++ /dev/null
-
-include(${CLR_DIR}/dac.cmake)
-
-add_precompiled_header(common.h ../common.cpp VM_SOURCES_DAC)
-add_library_clr(cee_dac ${VM_SOURCES_DAC})
-add_dependencies(cee_dac eventing_headers)
set(NEED_XPLAT_HEADER ON)
endif()
-include(FindPythonInterp)
+include(FindPython)
set (EventingHeaders
${GENERATED_INCLUDE_DIR}/etmdummy.h
set(GENEVENTING_SCRIPT ${CLR_DIR}/src/scripts/genEventing.py)
add_custom_target(eventing_headers
- ${PYTHON_EXECUTABLE} ${GENEVENTING_SCRIPT} --man ${EVENT_MANIFEST} --inc ${GENERATED_INCLUDE_DIR} --dummy ${GENERATED_INCLUDE_DIR}/etmdummy.h ${NONEXTERN_ARG} ${NOXPLATHEADER_ARG}
+ ${Python_EXECUTABLE} ${GENEVENTING_SCRIPT} --man ${EVENT_MANIFEST} --inc ${GENERATED_INCLUDE_DIR} --dummy ${GENERATED_INCLUDE_DIR}/etmdummy.h ${NONEXTERN_ARG} ${NOXPLATHEADER_ARG}
DEPENDS ${EVENT_MANIFEST} ${GENEVENTING_SCRIPT}
VERBATIM
)
cmake_minimum_required(VERSION 2.8.12)
-include(FindPythonInterp)
+include(FindPython)
set(ETW_PROVIDER_SCRIPT ${CLR_DIR}/src/scripts/genEtwProvider.py)
set_source_files_properties(${ETW_PROVIDER_OUTPUTS} PROPERTIES GENERATED TRUE)
add_custom_target(eventprovider
- ${PYTHON_EXECUTABLE} ${ETW_PROVIDER_SCRIPT} --man ${EVENT_MANIFEST} --exc ${EVENT_EXCLUSIONS} --intermediate ${GENERATED_INCLUDE_DIR}
+ ${Python_EXECUTABLE} ${ETW_PROVIDER_SCRIPT} --man ${EVENT_MANIFEST} --exc ${EVENT_EXCLUSIONS} --intermediate ${GENERATED_INCLUDE_DIR}
DEPENDS ${EVENT_MANIFEST} ${EVENT_EXCLUSIONS} ${ETW_PROVIDER_SCRIPT})
cmake_minimum_required(VERSION 2.8.12.2)
-include(FindPythonInterp)
+include(FindPython)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(GENERATE_SCRIPT ${CLR_DIR}/src/scripts/genEventPipe.py)
-set(GENERATE_COMMAND ${PYTHON_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --exc ${EVENT_EXCLUSIONS} --intermediate ${CMAKE_CURRENT_BINARY_DIR} ${NONEXTERN_ARG})
+set(GENERATE_COMMAND ${Python_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --exc ${EVENT_EXCLUSIONS} --intermediate ${CMAKE_CURRENT_BINARY_DIR} ${NONEXTERN_ARG})
execute_process(
COMMAND ${GENERATE_COMMAND} --dry-run
if (WIN32)
- add_precompiled_header(common.h ../common.cpp VM_SOURCES_WKS)
- # mscorlib.cpp does not compile with precompiled header file
- set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
-
- # asm files require preprocessing using cl.exe on arm32 and arm64
if(CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
-
- get_include_directories_asm(ASM_INCLUDE_DIRECTORIES)
-
- foreach(ASM_FILE ${VM_SOURCES_WKS_ARCH_ASM})
-
- # Inserts a custom command in CMake build to preprocess each asm source file
- get_filename_component(name ${ASM_FILE} NAME_WE)
- file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${name}.asm" ASM_PREPROCESSED_FILE)
- preprocess_def_file(${ASM_FILE} ${ASM_PREPROCESSED_FILE})
-
- # We do not pass any defines since we have already done pre-processing above
- set (ASM_CMDLINE "-o ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj ${ASM_PREPROCESSED_FILE}")
-
- # Generate the batch file that will invoke the assembler
- file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/runasm_${name}.cmd" ASM_SCRIPT_FILE)
-
- file(GENERATE OUTPUT "${ASM_SCRIPT_FILE}"
- CONTENT "\"${CMAKE_ASM_MASM_COMPILER}\" -g ${ASM_INCLUDE_DIRECTORIES} ${ASM_CMDLINE}")
-
- message("Generated - ${ASM_SCRIPT_FILE}")
-
- # Need to compile asm file using custom command as include directories are not provided to asm compiler
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj
- COMMAND ${ASM_SCRIPT_FILE}
- DEPENDS ${ASM_PREPROCESSED_FILE}
- COMMENT "Assembling ${ASM_PREPROCESSED_FILE} - ${ASM_SCRIPT_FILE}")
-
- # mark obj as source that does not require compile
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${name}.obj PROPERTIES EXTERNAL_OBJECT TRUE)
-
- # Add the generated OBJ in the dependency list so that it gets consumed during linkage
- set(VM_SOURCES_WKS_ARCH_ASM ${VM_SOURCES_WKS_ARCH_ASM} ${CMAKE_CURRENT_BINARY_DIR}/${name}.obj)
-
- endforeach()
-
+ preprocess_compile_asm(ASM_FILES ${VM_SOURCES_WKS_ARCH_ASM} OUTPUT_OBJECTS VM_WKS_ARCH_ASM_OBJECTS)
+ list(APPEND VM_SOURCES_WKS_ARCH_ASM ${VM_WKS_ARCH_ASM_OBJECTS})
endif()
endif (WIN32)
add_library_clr(cee_wks ${VM_SOURCES_WKS} ${VM_SOURCES_WKS_ARCH_ASM})
+target_precompile_header(TARGET cee_wks HEADER common.h)
+if (MSVC)
+ # mscorlib.cpp does not compile with precompiled header file
+ set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
+endif()
add_dependencies(cee_wks eventing_headers)
if (WIN32)
if(NOT CLR_CMAKE_PLATFORM_ARCH_ARM AND NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- # Get the current list of definitions
- get_compile_definitions(DEFINITIONS)
-
- get_directory_property(COMPILE_DEFINITIONS_LIST COMPILE_DEFINITIONS)
-
- # Extract the definitions for the ASM code. Since there is a bug in the cmake that prevents us from
- # using the generator expressions, we split the definitions into lists based on the configuration.
- foreach(DEFINITION IN LISTS COMPILE_DEFINITIONS_LIST)
- if (${DEFINITION} MATCHES "^\\$<\\$<CONFIG:([^>]+)>:([^>]+)>$")
- # The entry contains generator expression, so insert the definition into a definitions list
- # corresponding to the config
- string(TOUPPER ${CMAKE_MATCH_1} CONFIG)
- set(ASM_DEFINITIONS_${CONFIG} ${ASM_DEFINITIONS_${CONFIG}} ${CMAKE_MATCH_2})
- else()
- list(APPEND ASM_DEFINITIONS ${DEFINITION})
- endif()
- endforeach()
-
- # Add defines for the ASM. Unfortunately setting it on the target is ignored for asm by the cmake, so we have
- # to set it on the sources.
- set_property(SOURCE ${VM_SOURCES_WKS_ARCH_ASM} PROPERTY COMPILE_DEFINITIONS ${ASM_DEFINITIONS})
- foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
- string(TOUPPER ${CONFIG} CONFIG)
- set_property(SOURCE ${VM_SOURCES_WKS_ARCH_ASM} PROPERTY COMPILE_DEFINITIONS_${CONFIG} ${ASM_DEFINITIONS_${CONFIG}})
- endforeach()
if (CLR_CMAKE_PLATFORM_ARCH_I386)
set_source_files_properties(${VM_SOURCES_WKS_ARCH_ASM} PROPERTIES COMPILE_FLAGS "/Zm /safeseh")
message(FATAL_ERROR "POWERSHELL not found")
endif()
+ # Get the current list of definitions
+ get_compile_definitions(DEFINITIONS)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc"
DEPENDS ${VM_DIR}/${ARCH_SOURCES_DIR}/asmconstants.h
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc PROPERTIES GENERATED TRUE)
add_custom_target(
- asmconstants_inc
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc
+ asmconstants_inc
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc
)
add_dependencies(cee_wks asmconstants_inc)
--- /dev/null
+set(ZAP_SOURCES
+ svcworker.cpp
+ zapper.cpp
+ zaprelocs.cpp
+ zapcode.cpp
+ zapheaders.cpp
+ zapimage.cpp
+ zapinfo.cpp
+ zapimport.cpp
+ zapinnerptr.cpp
+ zapmetadata.cpp
+ zapwriter.cpp
+ zapwrapper.cpp
+ zapperstats.cpp
+ nativeformatwriter.cpp
+)
+
+set(ZAP_HEADERS
+ zaprelocs.h
+ zapcode.h
+ zapheaders.h
+ zapimage.h
+ zapinfo.h
+ zapimport.h
+ zapinnerptr.h
+ zaplog.h
+ zapmetadata.h
+ zapnodetype.h
+ zapwriter.h
+ zapwrapper.h
+ zapperstats.h
+ nativeformatwriter.h
+)
+
+if (FEATURE_READYTORUN)
+ list(APPEND ZAP_SOURCES
+ zapreadytorun.cpp
+ nativeformatwriter.cpp
+ )
+ list(APPEND ZAP_HEADERS
+ zapreadytorun.h
+ nativeformatwriter.h
+ )
+endif (FEATURE_READYTORUN)
+
+if (WIN32)
+ list(APPEND ZAP_SOURCES ${ZAP_HEADERS})
+endif(WIN32)
+
+add_library_clr(corzap_crossgen STATIC ${ZAP_SOURCES})
+set_target_properties(corzap_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+target_precompile_header(TARGET corzap_crossgen HEADER common.h)
+
+if(FEATURE_MERGE_JIT_AND_ENGINE)
+ target_link_libraries(corzap_crossgen clrjit_crossgen)
+endif(FEATURE_MERGE_JIT_AND_ENGINE)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//*****************************************************************************
-// common.cpp
-//
-
-//
-// Precompiled headers.
-//
-//*****************************************************************************
-#include "common.h"
+++ /dev/null
-include(${CLR_DIR}/crossgen.cmake)
-
-set(ZAP_SOURCES
- ../svcworker.cpp
- ../zapper.cpp
- ../zaprelocs.cpp
- ../zapcode.cpp
- ../zapheaders.cpp
- ../zapimage.cpp
- ../zapinfo.cpp
- ../zapimport.cpp
- ../zapinnerptr.cpp
- ../zapmetadata.cpp
- ../zapwriter.cpp
- ../zapwrapper.cpp
- ../zapperstats.cpp
- ../nativeformatwriter.cpp
-)
-
-set(ZAP_HEADERS
- ../zaprelocs.h
- ../zapcode.h
- ../zapheaders.h
- ../zapimage.h
- ../zapinfo.h
- ../zapimport.h
- ../zapinnerptr.h
- ../zaplog.h
- ../zapmetadata.h
- ../zapnodetype.h
- ../zapwriter.h
- ../zapwrapper.h
- ../zapperstats.h
- ../nativeformatwriter.h
-)
-
-if (FEATURE_READYTORUN)
- list(APPEND ZAP_SOURCES
- ../zapreadytorun.cpp
- ../nativeformatwriter.cpp
- )
- list(APPEND ZAP_HEADERS
- ../zapreadytorun.h
- ../nativeformatwriter.h
- )
-endif (FEATURE_READYTORUN)
-
-add_precompiled_header(common.h ../common.cpp ZAP_SOURCES)
-
-if (WIN32)
- list(APPEND ZAP_SOURCES ${ZAP_HEADERS})
-endif(WIN32)
-
-add_library_clr(corzap_crossgen STATIC ${ZAP_SOURCES})
-
-if(FEATURE_MERGE_JIT_AND_ENGINE)
- target_link_libraries(corzap_crossgen clrjit_crossgen)
-endif(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DWINDOWS)
endif()
-# Verify that LTCG/LTO is available
-include(${CMAKE_CURRENT_SOURCE_DIR}/../configure.cmake)
# Include global configure settings
include(${CMAKE_CURRENT_SOURCE_DIR}/../configurecompiler.cmake)
# Compile options