From 3d876f7d1c9c30075267747e5c148ebae0057bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 17 May 2021 12:43:05 +0200 Subject: [PATCH 01/16] WIP --- src/mono/mono/mini/CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 9326d86a94944..22bbf19a7e475 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -379,6 +379,27 @@ if(NOT DISABLE_SHARED_LIBS) add_library(monosgen-shared-dac SHARED "mini-windows-dlldac.c") set_target_properties(monosgen-shared-dac PROPERTIES OUTPUT_NAME ${MONO_SHARED_LIB_NAME}-dac) endif() + + + if(TARGET_DARWIN) + add_library(mono-framework SHARED $) + target_compile_definitions(mono-framework PRIVATE -DMONO_DLL_EXPORT) + target_sources(mono-framework PRIVATE $) + target_link_libraries(mono-framework PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) + if(ICU_LDFLAGS) + set_property(TARGET mono-framework APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + endif() + if(STATIC_ICU) + set_property(TARGET mono-framework APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) + endif () + set_property(TARGET mono-framework APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") + target_sources(mono-framework PRIVATE "${mono-components-objects}") + set_target_properties(mono-framework PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION C + MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework + ) + endif() endif() find_package(Python3 COMPONENTS Interpreter) From 82555d5fa70d31bcc8c4f789a96313f1e34f4f0e Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 27 May 2021 11:31:30 -0400 Subject: [PATCH 02/16] Copy mono-framework.framework to same build dir as monosgen --- src/mono/mono/mini/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 59335a1d20dd3..b04b27d874815 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -408,6 +408,9 @@ if(NOT DISABLE_SHARED_LIBS) FRAMEWORK_VERSION C MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework ) + install(TARGETS mono-framework + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) endif() endif() From 4879ec714537edf132fe18299bb73ce0dd0f4370 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 27 May 2021 11:36:21 -0400 Subject: [PATCH 03/16] Copy .frameworks to bin/ --- src/mono/mono.proj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a26e27c826b45..9aab05e7c2def 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -734,6 +734,12 @@ $(RuntimeBinDir)cross\$(PackageRID)\opt$(ExeExt) <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" /> + <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\mono-framework.framework\mono-framework"> + $(RuntimeBinDir)\mono-framework.framework\mono-framework + + <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\mono-framework.framework\Info.plist"> + $(RuntimeBinDir)\mono-framework.framework\Info.plist + <_MonoRuntimeArtifacts Condition="'$(_MonoIncludeInterpStaticFiles)' == 'true'" Include="$(MonoObjDir)out\lib\libmono-ee-interp.a"> $(RuntimeBinDir)libmono-ee-interp.a From 9e3bc177a4e1ef50c0e89030dfed0190e144f329 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 27 May 2021 13:28:36 -0400 Subject: [PATCH 04/16] Ship .framework in nupkg --- eng/liveBuilds.targets | 1 + .../Microsoft.NETCore.App.Runtime.props | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 66da71ac53f75..441fbfcd6ec62 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -109,6 +109,7 @@ true + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props index 19b7ac9409546..d9719deb04d82 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props @@ -70,6 +70,12 @@ runtimes/$(RuntimeIdentifier)/native/include/%(RecursiveDir) + + runtimes/$(RuntimeIdentifier)/native/mono-framework.framework/%(RecursiveDir) + + runtimes/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native From f97e1861d7e7b8a89a89c91c10649b59728b7549 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 3 Jun 2021 09:22:52 -0400 Subject: [PATCH 05/16] Rename mono-framework to Mono --- eng/liveBuilds.targets | 2 +- src/mono/mono.proj | 8 ++++---- src/mono/mono/mini/CMakeLists.txt | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index e357e55779c6e..793debf796df5 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -109,7 +109,7 @@ true - + diff --git a/src/mono/mono.proj b/src/mono/mono.proj index e2d713f4ce364..1f948f8c3ccf2 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -734,11 +734,11 @@ $(RuntimeBinDir)cross\$(PackageRID)\opt$(ExeExt) <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" /> - <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\mono-framework.framework\mono-framework"> - $(RuntimeBinDir)\mono-framework.framework\mono-framework + <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\Mono.framework\Mono"> + $(RuntimeBinDir)\Mono.framework\Mono - <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\mono-framework.framework\Info.plist"> - $(RuntimeBinDir)\mono-framework.framework\Info.plist + <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\Mono.framework\Info.plist"> + $(RuntimeBinDir)\Mono.framework\Info.plist <_MonoRuntimeArtifacts Condition="'$(_MonoIncludeInterpStaticFiles)' == 'true'" Include="$(MonoObjDir)out\lib\libmono-ee-interp.a"> $(RuntimeBinDir)libmono-ee-interp.a diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index b04b27d874815..d06414aa10e87 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -391,24 +391,24 @@ if(NOT DISABLE_SHARED_LIBS) if(TARGET_DARWIN) - add_library(mono-framework SHARED $) - target_compile_definitions(mono-framework PRIVATE -DMONO_DLL_EXPORT) - target_sources(mono-framework PRIVATE $) - target_link_libraries(mono-framework PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) + add_library(Mono SHARED $) + target_compile_definitions(Mono PRIVATE -DMONO_DLL_EXPORT) + target_sources(Mono PRIVATE $) + target_link_libraries(Mono PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) if(ICU_LDFLAGS) - set_property(TARGET mono-framework APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + set_property(TARGET Mono APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") endif() if(STATIC_ICU) - set_property(TARGET mono-framework APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) + set_property(TARGET Mono APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) endif () - set_property(TARGET mono-framework APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") - target_sources(mono-framework PRIVATE "${mono-components-objects}") - set_target_properties(mono-framework PROPERTIES + set_property(TARGET Mono APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") + target_sources(Mono PRIVATE "${mono-components-objects}") + set_target_properties(Mono PROPERTIES FRAMEWORK TRUE FRAMEWORK_VERSION C MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework ) - install(TARGETS mono-framework + install(TARGETS Mono FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() From 7d8d578e38b540e480cbf3812ee56dfeed7c9302 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 29 Jun 2021 14:45:00 -0400 Subject: [PATCH 06/16] Fix framework build on non-catalyst --- src/mono/mono/mini/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index d06414aa10e87..3e628e7015f95 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -402,7 +402,7 @@ if(NOT DISABLE_SHARED_LIBS) set_property(TARGET Mono APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) endif () set_property(TARGET Mono APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") - target_sources(Mono PRIVATE "${mono-components-objects}") + target_sources(Mono PRIVATE "${mono-components-stub-objects}") set_target_properties(Mono PROPERTIES FRAMEWORK TRUE FRAMEWORK_VERSION C From e97ec4ca667561138882105ab6fd440224872720 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 30 Jun 2021 13:09:00 -0400 Subject: [PATCH 07/16] Build stubby (release) and static-component (release) .frameworks --- eng/liveBuilds.targets | 3 +- .../Microsoft.NETCore.App.Runtime.props | 10 +++- src/mono/mono.proj | 14 ++++-- src/mono/mono/mini/CMakeLists.txt | 50 +++++++++++-------- 4 files changed, 50 insertions(+), 27 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 793debf796df5..772a77b71b73c 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -109,7 +109,8 @@ true - + + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props index 3f50991eedb32..1b5bacfc97d00 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props @@ -71,9 +71,15 @@ - runtimes/$(RuntimeIdentifier)/native/mono-framework.framework/%(RecursiveDir) + runtimes/$(RuntimeIdentifier)/native/Mono.release.framework/%(RecursiveDir) + + + + runtimes/$(RuntimeIdentifier)/native/Mono.debug.framework/%(RecursiveDir) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index bbed7e3ae34cd..6967fc4da1c61 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -770,11 +770,17 @@ $(RuntimeBinDir)cross\$(PackageRID)\opt$(ExeExt) <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" /> - <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\Mono.framework\Mono"> - $(RuntimeBinDir)\Mono.framework\Mono + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release"> + $(RuntimeBinDir)\Mono.release.framework\Mono - <_MonoRuntimeArtifacts Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Include="$(MonoObjDir)out\lib\Mono.framework\Info.plist"> - $(RuntimeBinDir)\Mono.framework\Info.plist + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug"> + $(RuntimeBinDir)\Mono.debug.framework\Mono + + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Info.plist"> + $(RuntimeBinDir)\Mono.release.framework\Info.plist + + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Info.plist"> + $(RuntimeBinDir)\Mono.debug.framework\Info.plist <_MonoRuntimeArtifacts Condition="'$(_MonoIncludeInterpStaticFiles)' == 'true'" Include="$(MonoObjDir)out\lib\libmono-ee-interp.a"> $(RuntimeBinDir)libmono-ee-interp.a diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 3e628e7015f95..b4e8ddb92099e 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -391,26 +391,36 @@ if(NOT DISABLE_SHARED_LIBS) if(TARGET_DARWIN) - add_library(Mono SHARED $) - target_compile_definitions(Mono PRIVATE -DMONO_DLL_EXPORT) - target_sources(Mono PRIVATE $) - target_link_libraries(Mono PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) - if(ICU_LDFLAGS) - set_property(TARGET Mono APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") - endif() - if(STATIC_ICU) - set_property(TARGET Mono APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) - endif () - set_property(TARGET Mono APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") - target_sources(Mono PRIVATE "${mono-components-stub-objects}") - set_target_properties(Mono PROPERTIES - FRAMEWORK TRUE - FRAMEWORK_VERSION C - MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework - ) - install(TARGETS Mono - FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) + string(REPLACE ";" "*" mono-components-objects-nowhitespace "${mono-components-objects}") + string(REPLACE ";" "*" mono-components-stub-objects-nowhitespace "${mono-components-stub-objects}") + list(APPEND FrameworkConfig Mono.release Mono.debug) + list(APPEND ComponentsObjects "${mono-components-objects-nowhitespace}" "${mono-components-stub-objects-nowhitespace}") + foreach(frameworkconfig componentsobjects IN ZIP_LISTS FrameworkConfig ComponentsObjects) + if("${componentsobjects}" STREQUAL "") + continue() + endif() + add_library(${frameworkconfig} SHARED $) + target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT) + target_sources(${frameworkconfig} PRIVATE $) + target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) + if(ICU_LDFLAGS) + set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + endif() + if(STATIC_ICU) + set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) + endif () + set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") + string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") + target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") + set_target_properties(${frameworkconfig} PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION C + MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework + ) + install(TARGETS ${frameworkconfig} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endforeach() endif() endif() From 75ea8d1e90d85b30e170dd73983f3e922804256e Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 30 Jun 2021 17:03:48 -0400 Subject: [PATCH 08/16] Strip frameworks --- src/mono/mono.proj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 6967fc4da1c61..1c2c207dd7025 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -505,6 +505,7 @@ + @@ -773,9 +774,15 @@ <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release"> $(RuntimeBinDir)\Mono.release.framework\Mono + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release.dwarf"> + $(RuntimeBinDir)\Mono.release.framework\Mono.dwarf + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug"> $(RuntimeBinDir)\Mono.debug.framework\Mono + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug.dwarf"> + $(RuntimeBinDir)\Mono.debug.framework\Mono.dwarf + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Info.plist"> $(RuntimeBinDir)\Mono.release.framework\Info.plist From 9bd0b0e0c2a5976c4513d52b9657cec642f6f8d1 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 1 Jul 2021 16:10:18 -0400 Subject: [PATCH 09/16] What if we flatten to iOS-style unversioned frameworks on non-iOS? --- src/mono/mono.proj | 20 ++++++++++++++++---- src/mono/mono/mini/CMakeLists.txt | 3 ++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 1c2c207dd7025..08235bcd8dfc8 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -771,22 +771,34 @@ $(RuntimeBinDir)cross\$(PackageRID)\opt$(ExeExt) <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" /> - <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release"> + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and !Exists('$(MonoObjDir)out\lib\Mono.release.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release"> + $(RuntimeBinDir)\Mono.release.framework\Mono + + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and Exists('$(MonoObjDir)out\lib\Mono.release.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Versions\Current\Mono.release"> $(RuntimeBinDir)\Mono.release.framework\Mono <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release.dwarf"> $(RuntimeBinDir)\Mono.release.framework\Mono.dwarf - <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug"> + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and !Exists('$(MonoObjDir)out\lib\Mono.debug.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug"> + $(RuntimeBinDir)\Mono.debug.framework\Mono + + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and Exists('$(MonoObjDir)out\lib\Mono.debug.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Versions\Current\Mono.debug"> $(RuntimeBinDir)\Mono.debug.framework\Mono <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug.dwarf"> $(RuntimeBinDir)\Mono.debug.framework\Mono.dwarf - <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Info.plist"> + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and !Exists('$(MonoObjDir)out\lib\Mono.release.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Info.plist"> $(RuntimeBinDir)\Mono.release.framework\Info.plist - <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Info.plist"> + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and Exists('$(MonoObjDir)out\lib\Mono.release.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Versions\Current\Resources\Info.plist"> + $(RuntimeBinDir)\Mono.release.framework\Info.plist + + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and !Exists('$(MonoObjDir)out\lib\Mono.debug.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Info.plist"> + $(RuntimeBinDir)\Mono.debug.framework\Info.plist + + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and Exists('$(MonoObjDir)out\lib\Mono.debug.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Versions\Current\Resources\Info.plist"> $(RuntimeBinDir)\Mono.debug.framework\Info.plist <_MonoRuntimeArtifacts Condition="'$(_MonoIncludeInterpStaticFiles)' == 'true'" Include="$(MonoObjDir)out\lib\libmono-ee-interp.a"> diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index b4e8ddb92099e..600f16941f84c 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -397,7 +397,8 @@ if(NOT DISABLE_SHARED_LIBS) list(APPEND ComponentsObjects "${mono-components-objects-nowhitespace}" "${mono-components-stub-objects-nowhitespace}") foreach(frameworkconfig componentsobjects IN ZIP_LISTS FrameworkConfig ComponentsObjects) if("${componentsobjects}" STREQUAL "") - continue() + #components list is empty, use stubs instead + set(componentsobjects "${mono-components-stub-objects-nowhitespace}") endif() add_library(${frameworkconfig} SHARED $) target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT) From 4ee0938426cd46c1837ac537365d2e595690cb26 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 2 Jul 2021 09:43:48 -0400 Subject: [PATCH 10/16] Fix stripping-dwarf-files bug --- src/mono/mono.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 1c2c207dd7025..b9264e2245763 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -505,7 +505,7 @@ - + From 8f544abddff5c97a03a54f94c8b813a8b8d2647b Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 2 Jul 2021 12:43:15 -0400 Subject: [PATCH 11/16] Bundle dylibs for components on dynamic component platforms --- src/mono/mono.proj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index ebb448757f2cd..18d654395ff2d 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -771,6 +771,9 @@ $(RuntimeBinDir)cross\$(PackageRID)\opt$(ExeExt) <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" /> + <_MonoRuntimeArtifacts Condition="'$(MonoComponentsStatic)' != 'true' and Exists('$(MonoObjDir)out\lib\Mono.release.framework')" Include="@(_MonoRuntimeComponentsSharedFilePath)"> + $(RuntimeBinDir)\Mono.release.framework\%(_MonoRuntimeComponentsSharedFilePath.Filename)%(_MonoRuntimeComponentsSharedFilePath.Extension) + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework') and !Exists('$(MonoObjDir)out\lib\Mono.release.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release"> $(RuntimeBinDir)\Mono.release.framework\Mono @@ -780,6 +783,9 @@ <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.release.framework')" Include="$(MonoObjDir)out\lib\Mono.release.framework\Mono.release.dwarf"> $(RuntimeBinDir)\Mono.release.framework\Mono.dwarf + <_MonoRuntimeArtifacts Condition="'$(MonoComponentsStatic)' != 'true' and Exists('$(MonoObjDir)out\lib\Mono.debug.framework')" Include="@(_MonoRuntimeComponentsSharedFilePath)"> + $(RuntimeBinDir)\Mono.debug.framework\%(_MonoRuntimeComponentsSharedFilePath.Filename)%(_MonoRuntimeComponentsSharedFilePath.Extension) + <_MonoRuntimeArtifacts Condition="Exists('$(MonoObjDir)out\lib\Mono.debug.framework') and !Exists('$(MonoObjDir)out\lib\Mono.debug.framework\Versions')" Include="$(MonoObjDir)out\lib\Mono.debug.framework\Mono.debug"> $(RuntimeBinDir)\Mono.debug.framework\Mono From db386eefb65465bd3ad16bc6ce9aeacd475b79b2 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 6 Jul 2021 16:18:36 -0400 Subject: [PATCH 12/16] Only build .frameworks if explicitly turned on; turn on in relevant CI lanes --- eng/pipelines/common/global-build-job.yml | 8 ++- eng/pipelines/mono/templates/build-job.yml | 12 +++- eng/pipelines/runtime-staging.yml | 2 +- src/mono/mono.proj | 1 + src/mono/mono/mini/CMakeLists.txt | 67 +++++++++++----------- 5 files changed, 54 insertions(+), 36 deletions(-) diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 96c116eb87272..84f1786bd2171 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -83,6 +83,12 @@ jobs: ${{ if ne(parameters.isOfficialBuild, true) }}: value: '' + - name: _buildDarwinFrameworksParameter + ${{ if in(parameters.osGroup, 'iOS', 'tvOS', 'MacCatalyst')}}: + value: /p:BuildDarwinFrameworks=true + ${{ if notin(parameters.osGroup, 'iOS', 'tvOS', 'MacCatalyst')}}: + value: '' + - name: _richCodeNavigationParam ${{ if eq(parameters.enableRichCodeNavigation, true) }}: value: /p:EnableRichCodeNavigation=true @@ -134,7 +140,7 @@ jobs: displayName: Install native dependencies # Build - - script: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_richCodeNavigationParam) + - script: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_richCodeNavigationParam) $(_buildDarwinFrameworksParameter) displayName: Build product ${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}: continueOnError: ${{ parameters.shouldContinueOnError }} diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index ef9af237168b7..35c7ba65c2074 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -63,6 +63,8 @@ jobs: value: '' - name: msCorDbi value: '+mono.mscordbi' + - name: darwinFrameworks + value: '' - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: - name: officialBuildIdArg value: '/p:officialBuildId=$(Build.BuildNumber)' @@ -76,15 +78,23 @@ jobs: - ${{ if eq(parameters.osGroup, 'tvOS') }}: - name: osOverride value: -os tvOS + - name: darwinFrameworks + value: /p:BuildDarwinFrameworks=true - ${{ if eq(parameters.osGroup, 'tvOSSimulator') }}: - name: osOverride value: -os tvOSSimulator + - name: darwinFrameworks + value: /p:BuildDarwinFrameworks=true - ${{ if eq(parameters.osGroup, 'iOS') }}: - name: osOverride value: -os iOS + - name: darwinFrameworks + value: /p:BuildDarwinFrameworks=true - ${{ if eq(parameters.osGroup, 'iOSSimulator') }}: - name: osOverride value: -os iOSSimulator + - name: darwinFrameworks + value: /p:BuildDarwinFrameworks=true - ${{ if eq(parameters.osGroup, 'Android') }}: - name: osOverride value: -os Android @@ -136,7 +146,7 @@ jobs: # Build - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: ./build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) + - script: ./build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(DarwinFrameworks)) displayName: Build product - ${{ if eq(parameters.osGroup, 'windows') }}: - script: build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 666641354bf5a..f58caca2899de 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -119,7 +119,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:MonoForceInterpreter=true + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true timeoutInMinutes: 180 condition: >- or( diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 18d654395ff2d..6bca3b49e881f 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -198,6 +198,7 @@ <_MonoCMakeArgs Include="-DCMAKE_BUILD_TYPE=$(Configuration)"/> <_MonoCMakeArgs Condition="'$(CMakeArgs)' != ''" Include="$(CMakeArgs)"/> <_MonoCMakeArgs Condition="'$(MonoEnableLLVM)' == 'true'" Include="-DLLVM_PREFIX=$(MonoLLVMDir.TrimEnd('\/'))" /> + <_MonoCMakeArgs Condition="'$(BuildDarwinFrameworks)' == 'true'" Include="-DBUILD_DARWIN_FRAMEWORKS=1" /> <_MonoCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" /> <_MonoCMakeArgs Include="-DMONO_LIB_NAME=$(MonoLibName)" /> <_MonoCMakeArgs Include="-DMONO_SHARED_LIB_NAME=$(MonoSharedLibName)" /> diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 88695db8082ff..ca3b9137ff64f 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -382,39 +382,40 @@ if(NOT DISABLE_SHARED_LIBS) set_target_properties(monosgen-shared-dac PROPERTIES OUTPUT_NAME ${MONO_SHARED_LIB_NAME}-dac) endif() - - if(TARGET_DARWIN) - string(REPLACE ";" "*" mono-components-objects-nowhitespace "${mono-components-objects}") - string(REPLACE ";" "*" mono-components-stub-objects-nowhitespace "${mono-components-stub-objects}") - list(APPEND FrameworkConfig Mono.release Mono.debug) - list(APPEND ComponentsObjects "${mono-components-objects-nowhitespace}" "${mono-components-stub-objects-nowhitespace}") - foreach(frameworkconfig componentsobjects IN ZIP_LISTS FrameworkConfig ComponentsObjects) - if("${componentsobjects}" STREQUAL "") - #components list is empty, use stubs instead - set(componentsobjects "${mono-components-stub-objects-nowhitespace}") - endif() - add_library(${frameworkconfig} SHARED $) - target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT) - target_sources(${frameworkconfig} PRIVATE $) - target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) - if(ICU_LDFLAGS) - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") - endif() - if(STATIC_ICU) - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) - endif () - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") - string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") - target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") - set_target_properties(${frameworkconfig} PROPERTIES - FRAMEWORK TRUE - FRAMEWORK_VERSION C - MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework - ) - install(TARGETS ${frameworkconfig} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - endforeach() + if(BUILD_DARWIN_FRAMEWORKS) + if(TARGET_DARWIN) + string(REPLACE ";" "*" mono-components-objects-nowhitespace "${mono-components-objects}") + string(REPLACE ";" "*" mono-components-stub-objects-nowhitespace "${mono-components-stub-objects}") + list(APPEND FrameworkConfig Mono.release Mono.debug) + list(APPEND ComponentsObjects "${mono-components-objects-nowhitespace}" "${mono-components-stub-objects-nowhitespace}") + foreach(frameworkconfig componentsobjects IN ZIP_LISTS FrameworkConfig ComponentsObjects) + if("${componentsobjects}" STREQUAL "") + #components list is empty, use stubs instead + set(componentsobjects "${mono-components-stub-objects-nowhitespace}") + endif() + add_library(${frameworkconfig} SHARED $) + target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT) + target_sources(${frameworkconfig} PRIVATE $) + target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS}) + if(ICU_LDFLAGS) + set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + endif() + if(STATIC_ICU) + set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) + endif () + set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") + string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") + target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") + set_target_properties(${frameworkconfig} PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION C + MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework + ) + install(TARGETS ${frameworkconfig} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endforeach() + endif() endif() endif() From 62ab8ae3541c17e5268c0be5d22f0e640349743d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 6 Jul 2021 17:07:37 -0400 Subject: [PATCH 13/16] Typo --- eng/pipelines/mono/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index 35c7ba65c2074..d07f13a4de58c 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -146,7 +146,7 @@ jobs: # Build - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: ./build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(DarwinFrameworks)) + - script: ./build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(DarwinFrameworks) displayName: Build product - ${{ if eq(parameters.osGroup, 'windows') }}: - script: build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) From 2837fcbd9a699956420d4ec2629af59cd22bbd4b Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 7 Jul 2021 14:26:50 -0400 Subject: [PATCH 14/16] Fix casing (from Mitch) --- eng/pipelines/mono/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index d07f13a4de58c..bdb15a09a665e 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -146,7 +146,7 @@ jobs: # Build - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: ./build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(DarwinFrameworks) + - script: ./build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(darwinFrameworks) displayName: Build product - ${{ if eq(parameters.osGroup, 'windows') }}: - script: build$(scriptExt) -subset mono$(msCorDbi) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) From 65e00a7b620e05c31d57a36f925dabe6b74fbdb0 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 7 Jul 2021 14:33:57 -0400 Subject: [PATCH 15/16] Add explanation of whitespace fiddling to bypass cmake list limitations --- src/mono/mono/mini/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index ca3b9137ff64f..e66f2fa5b8abb 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -384,6 +384,11 @@ if(NOT DISABLE_SHARED_LIBS) if(BUILD_DARWIN_FRAMEWORKS) if(TARGET_DARWIN) + # In cmake, you cannot have list entries which contain a space or semicolon - those are considered + # record separators (i.e. a list of list(APPEND foo "a" "b;c" "d e") is a five entry list of values + # a, b, c, d and e. + # So, in order to treat the components lists as single list entries, swap out the ; character + # for a temporary replacement character, allowing the full lists to be treated as single entries string(REPLACE ";" "*" mono-components-objects-nowhitespace "${mono-components-objects}") string(REPLACE ";" "*" mono-components-stub-objects-nowhitespace "${mono-components-stub-objects}") list(APPEND FrameworkConfig Mono.release Mono.debug) From 29e9413c4b51f1453cf7d52b860472536dfd10be Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 7 Jul 2021 14:44:51 -0400 Subject: [PATCH 16/16] Release and debug were reversed (debug should get full objects, not stubs) --- src/mono/mono/mini/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index e66f2fa5b8abb..841bff5f566cf 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -391,7 +391,7 @@ if(NOT DISABLE_SHARED_LIBS) # for a temporary replacement character, allowing the full lists to be treated as single entries string(REPLACE ";" "*" mono-components-objects-nowhitespace "${mono-components-objects}") string(REPLACE ";" "*" mono-components-stub-objects-nowhitespace "${mono-components-stub-objects}") - list(APPEND FrameworkConfig Mono.release Mono.debug) + list(APPEND FrameworkConfig Mono.debug Mono.release) list(APPEND ComponentsObjects "${mono-components-objects-nowhitespace}" "${mono-components-stub-objects-nowhitespace}") foreach(frameworkconfig componentsobjects IN ZIP_LISTS FrameworkConfig ComponentsObjects) if("${componentsobjects}" STREQUAL "")