diff --git a/eng/Subsets.props b/eng/Subsets.props index 5770eec315eb4d..d5dd0b9e06817b 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -178,7 +178,7 @@ <_subset>$(_subset.Replace('+host+', '+$(DefaultHostSubsets)+')) <_subset>$(_subset.Replace('+packs+', '+$(DefaultPacksSubsets)+')) <_subset>$(_subset.Replace('+bootstrap+', '+bootstrap+$(BootstrapSubsets)+')) - <_subset Condition="'$(TargetOS)' == 'browser'">$(_subset.Replace('+clr.runtime+', '+mono.emsdk+clr.runtime+')) + <_subset Condition="'$(TargetOS)' == 'browser'">$(_subset.Replace('+clr.runtime+', '+mono.emsdk+clr.corelib+clr.runtime+')) <_subset>+$(_subset.Trim('+'))+ diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index cecb2f93a2ac82..5b5ad8e6789ad0 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -594,11 +594,29 @@ function(install_clr) endif() foreach(destination ${destinations}) - # We don't need to install the export libraries for our DLLs - # since they won't be directly linked against. - install(PROGRAMS $ DESTINATION ${destination} COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL}) - if (NOT "${symbolFile}" STREQUAL "") - install_symbol_file(${symbolFile} ${destination} COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL}) + # CMake bug with executable WASM outputs - https://gitlab.kitware.com/cmake/cmake/-/issues/20745 + if (CLR_CMAKE_TARGET_ARCH_WASM AND "${targetType}" STREQUAL "EXECUTABLE") + # Use install FILES since these are WASM assets that aren't executable. + install(FILES + "$/${targetName}.js" + "$/${targetName}.wasm" + DESTINATION ${destination} COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL}) + + # Conditionally check for and copy any extra data file at install time. + install(CODE + " + if(EXISTS \"$/${targetName}.data\") + file(INSTALL \"$/${targetName}.data\" DESTINATION \"${CMAKE_INSTALL_PREFIX}/${destination}\") + endif() + " + COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL}) + else() + # We don't need to install the export libraries for our DLLs + # since they won't be directly linked against. + install(PROGRAMS $ DESTINATION ${destination} COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL}) + if (NOT "${symbolFile}" STREQUAL "") + install_symbol_file(${symbolFile} ${destination} COMPONENT ${INSTALL_CLR_COMPONENT} ${INSTALL_CLR_OPTIONAL}) + endif() endif() if(CLR_CMAKE_PGO_INSTRUMENT) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index b1433e14def45b..189583be53c4b3 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -110,10 +110,6 @@ if(CLR_CMAKE_HOST_UNIX) endif() add_subdirectory(pal) - - if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS) - add_subdirectory(hosts) - endif() else() if(CLR_CMAKE_TARGET_UNIX) add_subdirectory(${CLR_SRC_NATIVE_DIR}/external/libunwind_extras ${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind) @@ -311,8 +307,5 @@ endif() if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS) add_subdirectory(tools) -endif(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS) - -if(CLR_CMAKE_HOST_WIN32) add_subdirectory(hosts) -endif(CLR_CMAKE_HOST_WIN32) +endif(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS) diff --git a/src/coreclr/hosts/corewasmrun/CMakeLists.txt b/src/coreclr/hosts/corewasmrun/CMakeLists.txt index 01613dde60315a..2f5bd50cbce7a2 100644 --- a/src/coreclr/hosts/corewasmrun/CMakeLists.txt +++ b/src/coreclr/hosts/corewasmrun/CMakeLists.txt @@ -18,11 +18,15 @@ endif (EXISTS "${_WASM_PRELOAD_DIR}") target_compile_options(corewasmrun PRIVATE -fwasm-exceptions) target_link_options(corewasmrun PRIVATE -fwasm-exceptions -sEXIT_RUNTIME=1 -sINITIAL_MEMORY=134217728 -sFORCE_FILESYSTEM=1 ${_WASM_PRELOAD_FILE} -Wl,-error-limit=0) -target_link_libraries(corewasmrun PRIVATE coreclr_static) -target_link_libraries(corewasmrun PRIVATE clrinterpreter) - -target_link_libraries(corewasmrun PRIVATE icuuc) -target_link_libraries(corewasmrun PRIVATE icui18n) -target_link_libraries(corewasmrun PRIVATE icudata) - -install_clr(TARGETS corewasmrun DESTINATIONS . COMPONENT hosts) +target_link_libraries(corewasmrun PRIVATE + coreclr_static + clrinterpreter + icuuc + icui18n + icudata) + +# The corerun version for wasm is being installed in its own directory +# because it is an executable that comes with an index.html and we +# want to avoid clashes. +install_clr(TARGETS corewasmrun DESTINATIONS corewasmrun COMPONENT hosts) +install(FILES index.html DESTINATION corewasmrun COMPONENT hosts) diff --git a/src/coreclr/inc/bundle.h b/src/coreclr/inc/bundle.h index 3aa76e3651dac0..5369b45e1c5ef6 100644 --- a/src/coreclr/inc/bundle.h +++ b/src/coreclr/inc/bundle.h @@ -11,7 +11,7 @@ #define _BUNDLE_H_ #include -#include "coreclrhost.h" +#include class Bundle; diff --git a/src/coreclr/inc/pinvokeoverride.h b/src/coreclr/inc/pinvokeoverride.h index 3cec8c5b4982b3..a20bc3921b7f8c 100644 --- a/src/coreclr/inc/pinvokeoverride.h +++ b/src/coreclr/inc/pinvokeoverride.h @@ -10,7 +10,7 @@ #ifndef _PINVOKEOVERRIDE_H_ #define _PINVOKEOVERRIDE_H_ -#include "coreclrhost.h" +#include class PInvokeOverride {