Skip to content

Commit

Permalink
Fix regression in cross OS DAC compilation (#31901)
Browse files Browse the repository at this point in the history
Fix DAC cross OS compilations regressions introduced by #31659
  • Loading branch information
sdmaclea committed Feb 7, 2020
1 parent 1275e5f commit e2c6c72
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
19 changes: 12 additions & 7 deletions src/coreclr/src/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CLR_DAC_SOURCES

add_definitions(-DFX_VER_INTERNALNAME_STR=mscordaccore.dll)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
list(APPEND CLR_DAC_SOURCES
Native.rc
)
Expand All @@ -24,7 +24,7 @@ if(CLR_CMAKE_TARGET_WIN32)
# No library groups for Win32
set(START_LIBRARY_GROUP)
set(END_LIBRARY_GROUP)
else(CLR_CMAKE_TARGET_WIN32)
else(CLR_CMAKE_HOST_WIN32)
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordac_unixexports.src)
set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordac.exports)

Expand Down Expand Up @@ -71,7 +71,7 @@ else(CLR_CMAKE_TARGET_WIN32)
# Add lib redefines file to DAC
list(APPEND CLR_DAC_SOURCES libredefines.S)
endif(CLR_CMAKE_HOST_LINUX)
endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)

if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
# This option is necessary to ensure that the overloaded delete operator defined inside
Expand Down Expand Up @@ -136,6 +136,12 @@ set(COREDAC_LIBRARIES
)

if(CLR_CMAKE_TARGET_WIN32)
list(APPEND COREDAC_LIBRARIES
mdwinmd_dac
)
endif(CLR_CMAKE_TARGET_WIN32)

if(CLR_CMAKE_HOST_WIN32)
# mscordac.def should be generated before mscordaccore.dll is built
add_dependencies(mscordaccore mscordaccore_def)

Expand All @@ -160,7 +166,6 @@ if(CLR_CMAKE_TARGET_WIN32)
set(COREDAC_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.exp # export file
${COREDAC_LIBRARIES}
mdwinmd_dac
kernel32.lib
advapi32.lib
ole32.lib
Expand All @@ -170,23 +175,23 @@ if(CLR_CMAKE_TARGET_WIN32)
${STATIC_MT_CRT_LIB}
${STATIC_MT_VCRT_LIB}
)
else(CLR_CMAKE_TARGET_WIN32)
else(CLR_CMAKE_HOST_WIN32)
list(APPEND COREDAC_LIBRARIES
mscorrc_debug
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
coreclrpal
palrt
${END_WHOLE_ARCHIVE}
)
endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)

target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES})

# add the install targets
install_clr(TARGETS mscordaccore)
install_clr(TARGETS mscordaccore DESTINATION sharedFramework SKIP_STRIP)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
set(LONG_NAME_HOST_ARCH ${CLR_CMAKE_HOST_ARCH})
set(LONG_NAME_TARGET_ARCH ${CLR_CMAKE_TARGET_ARCH})
if (LONG_NAME_HOST_ARCH STREQUAL x64)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/dlls/mscorrc/full/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_definitions(-DFX_VER_INTERNALNAME_STR=mscorrc.debug.dll)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)

add_library_clr(mscorrc.debug SHARED
../include.rc
Expand All @@ -16,5 +16,5 @@ else()
${TARGET_CPP_FILE}
)

endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)

6 changes: 3 additions & 3 deletions src/coreclr/src/hosts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include_directories(inc)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
add_subdirectory(corerun)
add_subdirectory(coreconsole)
add_subdirectory(coreshim)
else(CLR_CMAKE_TARGET_WIN32)
else(CLR_CMAKE_HOST_WIN32)
add_subdirectory(unixcoreruncommon)
add_subdirectory(unixcorerun)
add_subdirectory(unixcoreconsole)
if(CLR_CMAKE_HOST_DARWIN)
add_subdirectory(osxbundlerun)
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)
4 changes: 2 additions & 2 deletions src/coreclr/src/vm/eventing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(EVENT_MANIFEST ${VM_DIR}/ClrEtwAll.man)
set(EVENT_EXCLUSIONS ${VM_DIR}/ClrEtwAllMeta.lst)

if (CLR_CMAKE_TARGET_WIN32)
if (CLR_CMAKE_HOST_WIN32)
set(NONEXTERN_ARG "--nonextern")
set(NOXPLATHEADER_ARG "--noxplatheader")
else()
Expand Down Expand Up @@ -35,6 +35,6 @@ add_dependencies(eventing_headers eventprovider)

add_subdirectory(eventpipe)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
add_subdirectory(EtwProvider)
endif()

0 comments on commit e2c6c72

Please sign in to comment.