endif(CLR_CMAKE_PLATFORM_UNIX)
endfunction()
-function(install_clr targetName)
- 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)
-
- # 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 .)
- endif()
- if(CLR_CMAKE_PGO_INSTRUMENT)
+# install_clr(TARGETS TARGETS targetName [targetName2 ...] [DESTINATION destination])
+function(install_clr)
+ set(options "")
+ set(oneValueArgs DESTINATION)
+ set(multiValueArgs TARGETS)
+ cmake_parse_arguments(PARSE_ARGV 0 INSTALL_CLR "${options}" "${oneValueArgs}" "${multiValueArgs}")
+
+ if ("${INSTALL_CLR_TARGETS}" STREQUAL "")
+ message(FATAL_ERROR "At least one target must be passed to install_clr(TARGETS )")
+ endif()
+
+ if ("${INSTALL_CLR_DESTINATION}" STREQUAL "")
+ set(INSTALL_CLR_DESTINATION ".")
+ endif()
+
+ foreach(targetName ${INSTALL_CLR_TARGETS})
+ 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)
+
+ # 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 ${INSTALL_CLR_DESTINATION})
if(WIN32)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pgd DESTINATION PGD OPTIONAL)
+ # 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 ${INSTALL_CLR_DESTINATION}/PDB)
+ else()
+ install(FILES ${strip_destination_file} DESTINATION ${INSTALL_CLR_DESTINATION})
+ endif()
+ if(CLR_CMAKE_PGO_INSTRUMENT)
+ if(WIN32)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pgd DESTINATION ${INSTALL_CLR_DESTINATION}/PGD OPTIONAL)
+ endif()
endif()
endif()
- endif()
+ endforeach()
endfunction()
# Disable PAX mprotect that would prevent JIT and other codegen in coreclr from working.
endif(WIN32)
_install(FILES SOS_README.md DESTINATION .)
+_install(FILES SOS_README.md DESTINATION sharedFramework)
)
# Can't compile on linux yet so only add for windows
- install_clr(CoreConsole)
+ install_clr(TARGETS CoreConsole)
-endif(CLR_CMAKE_PLATFORM_UNIX)
\ No newline at end of file
+endif(CLR_CMAKE_PLATFORM_UNIX)
)
# Can't compile on linux yet so only add for windows
- install_clr(CoreRun)
+ install_clr(TARGETS CoreRun)
-endif(CLR_CMAKE_PLATFORM_UNIX)
\ No newline at end of file
+endif(CLR_CMAKE_PLATFORM_UNIX)
${STATIC_MT_VCRT_LIB}
)
-install_clr(CoreShim)
\ No newline at end of file
+install_clr(TARGETS CoreShim)
coreclr
)
-install_clr(osxbundlerun)
+install_clr(TARGETS osxbundlerun)
)
endif()
-install_clr(coreconsole)
+install_clr(TARGETS coreconsole)
)
endif()
-install_clr(corerun)
+install_clr(TARGETS corerun)
)
# add the install targets
-install_clr(System.Globalization.Native)
+install_clr(TARGETS System.Globalization.Native)
+install_clr(TARGETS System.Globalization.Native DESTINATION sharedFramework)
install(TARGETS System.Globalization.Native_Static DESTINATION .)
add_dependencies(createdump mscordaccore)
-install_clr(createdump)
+install_clr(TARGETS createdump)
)
# add the install targets
-install_clr(clretwrc)
+install_clr(TARGETS clretwrc)
+install_clr(TARGETS clretwrc DESTINATION sharedFramework)
add_dependencies(clretwrc eventing_headers)
target_link_libraries(dbgshim ${DBGSHIM_LIBRARIES})
# add the install targets
-install_clr(dbgshim)
+install_clr(TARGETS dbgshim)
+install_clr(TARGETS dbgshim DESTINATION sharedFramework)
target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES})
# add the install targets
-install_clr(mscordaccore)
+install_clr(TARGETS mscordaccore)
+install_clr(TARGETS mscordaccore DESTINATION sharedFramework)
+if(WIN32)
+ set(LONG_NAME_HOST_ARCH ${CLR_CMAKE_HOST_ARCH})
+ set(LONG_NAME_TARGET_ARCH ${CLR_CMAKE_TARGET_ARCH})
+ if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
+ set(LONG_NAME_HOST_ARCH "amd64")
+ set(LONG_NAME_TARGET_ARCH "amd64")
+ endif()
+ set(NATIVE_VERSION_HEADER_FILE "${CLR_DIR}/bin/obj/_version.h")
+ message ("Read file version from native version header at '${NATIVE_VERSION_HEADER_FILE}'.")
+ file(READ "${NATIVE_VERSION_HEADER_FILE}" NATIVE_VERSION_HEADER)
+ string(REGEX MATCH "#define VER_FILEVERSION[ \t]+[0-9]+(,[0-9]+)+" FILE_VERSION_LINE "${NATIVE_VERSION_HEADER}")
+ string(REGEX MATCHALL "[0-9]+" FILE_VERSION_COMPONENTS "${FILE_VERSION_LINE}")
+ list(JOIN FILE_VERSION_COMPONENTS "." FILE_VERSION)
+ install(FILES $<TARGET_FILE:mscordaccore> RENAME mscordaccore_${LONG_NAME_HOST_ARCH}_${LONG_NAME_TARGET_ARCH}_${FILE_VERSION}.dll DESTINATION sharedFramework)
+endif()
endif(WIN32)
# add the install targets
-install_clr(mscordbi)
+install_clr(TARGETS mscordbi)
+install_clr(TARGETS mscordbi DESTINATION sharedFramework)
endif(WIN32)
# add the install targets
-install_clr(coreclr)
+install_clr(TARGETS coreclr)
+install_clr(TARGETS coreclr DESTINATION sharedFramework)
# Enable profile guided optimization
add_pgo(coreclr)
../include.rc
)
- install_clr (mscorrc.debug)
+ install_clr(TARGETS mscorrc.debug)
+ install_clr(TARGETS mscorrc.debug DESTINATION sharedFramework)
else()
build_resources(${CMAKE_CURRENT_SOURCE_DIR}/../include.rc mscorrc_debug TARGET_CPP_FILE)
../mscorrc.small.rc
)
-# add the install targets
-install_clr (mscorrc)
\ No newline at end of file
+install_clr(TARGETS mscorrc)
+install_clr(TARGETS mscorrc DESTINATION sharedFramework)
add_library_clr(clrgc SHARED ${GC_SOURCES})
add_dependencies(clrgc eventing_headers)
target_link_libraries(clrgc ${GC_LINK_LIBRARIES})
-install_clr(clrgc)
+install_clr(TARGETS clrgc)
if(CLR_CMAKE_PLATFORM_UNIX)
# dprintf causes many warnings (https://github.com/dotnet/coreclr/issues/13367)
)
endif(CLR_CMAKE_PLATFORM_UNIX)
-install_clr(ilasm)
+install_clr(TARGETS ilasm)
)
endif(CLR_CMAKE_PLATFORM_UNIX)
-install_clr(ildasm)
+install_clr(TARGETS ildasm)
)
# add the install targets
-install_clr(armelnonjit)
+install_clr(TARGETS armelnonjit)
)
# add the install targets
-install_clr(linuxnonjit)
+install_clr(TARGETS linuxnonjit)
)
# add the install targets
-install_clr(protojit)
+install_clr(TARGETS protojit)
)
# add the install targets
-install_clr(protononjit)
+install_clr(TARGETS protononjit)
)
# add the install targets
-install_clr(clrjit)
+install_clr(TARGETS clrjit)
+install_clr(TARGETS clrjit DESTINATION sharedFramework)
# Enable profile guided optimization
add_pgo(clrjit)
# Install the static eventprovider library
_install(TARGETS eventprovider DESTINATION lib)
# Install the static coreclrtraceptprovider library
-install_clr(coreclrtraceptprovider)
+install_clr(TARGETS coreclrtraceptprovider)
add_subdirectory(../../vm/crossgen ../../vm/crossgen)
# add the install targets
-install_clr(crossgen)
+install_clr(TARGETS crossgen)
+install_clr(TARGETS crossgen DESTINATION sharedFramework)
${NATIVE_SOURCES}
)
-install_clr(jitinterface)
+install_clr(TARGETS jitinterface)