add_compile_options(/EHsc) # set exception handling behavior
add_compile_options(/FC) # use full pathnames in diagnostics
if(CMAKE_BUILD_TYPE STREQUAL "Release")
- add_compile_options(/Oi) # enable intrinsics
- add_compile_options(/GF) # enable string pooling
- add_compile_options(/Zi) # enable debugging information
- add_compile_options(/GL) # whole program optimization
- add_link_options(/LTCG) # link-time code generation
+ add_compile_options(/Oi) # enable intrinsics
+ add_compile_options(/GF) # enable string pooling
+ add_compile_options(/Zi) # enable debugging information
+ add_compile_options(/GL) # whole program optimization
+ add_link_options(/LTCG) # link-time code generation
+ add_link_options(/DEBUG) # enable debugging information
+ add_link_options(/OPT:REF) # optimize: remove unreferenced functions & data
+ add_link_options(/OPT:ICF) # optimize: enable COMDAT folding
+ # the combination of /Zi compiler flag and /DEBUG /OPT:REF /OPT:ICF
+ # linker flags is needed to create .pdb output on release builds
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HOST_SOLARIS 1)
<MonoStaticLibFileName>$(LibPrefix)$(MonoLibName)$(StaticLibExt)</MonoStaticLibFileName>
<MonoFileName Condition="'$(TargetsBrowser)' == 'true'">$(MonoStaticLibFileName)</MonoFileName>
<MonoFileName Condition="'$(MonoFileName)' == ''">$(MonoSharedLibFileName)</MonoFileName>
+ <MonoAotCrossFileName>mono-aot-cross$(ExeExt)</MonoAotCrossFileName>
+ <MonoAotCrossPdbFileName>mono-aot-cross.pdb</MonoAotCrossPdbFileName>
<CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
<LibrariesTestConfig Condition="'$(LibrariesTestConfig)' == ''">$(Configuration)</LibrariesTestConfig>
<CoreClrTestCoreRoot>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tests', 'coreclr', '$(TargetOS).$(Platform).$(CoreClrTestConfig)', 'Tests', 'Core_Root'))</CoreClrTestCoreRoot>
<MonoAOTCMakeArgs Include="$(_MonoAOTCXXFLAGSOption)" />
<!-- thread suspend -->
<MonoAOTCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" />
+ <!-- rename exe -->
+ <MonoAOTCMakeArgs Include="-DMONO_CROSS_COMPILE_EXECUTABLE_NAME=1" />
</ItemGroup>
<PropertyGroup>
<_MonoIncludeIcuFiles Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">true</_MonoIncludeIcuFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'">
- <_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\mono-sgen$(ExeExt)</_MonoAotCrossFilePath>
+ <_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossFileName)</_MonoAotCrossFilePath>
+ <_MonoAotCrossPdbFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossPdbFileName)</_MonoAotCrossPdbFilePath>
</PropertyGroup>
<!-- Copy Mono runtime files to artifacts directory -->
<Destination>$(RuntimeBinDir)%(_MonoRuntimeComponentsSharedFilePath.Filename)%(_MonoRuntimeComponentsSharedFilePath.Extension)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)">
- <Destination>$(RuntimeBinDir)cross\$(PackageRID)\mono-aot-cross$(ExeExt)</Destination>
+ <Destination>$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossFileName)</Destination>
+ </_MonoRuntimeArtifacts>
+ <_MonoRuntimeArtifacts Include="$(_MonoAotCrossPdbFilePath)" Condition="Exists('$(_MonoAotCrossPdbFilePath)')">
+ <Destination>$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossPdbFileName)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\bin\llc$(ExeExt)">
<Destination>$(RuntimeBinDir)\llc$(ExeExt)</Destination>
set(sgen_sources "${sgen_sources};${PROJECT_BINARY_DIR}/../../NativeVersion.rc")
endif()
add_executable(mono-sgen "${sgen_sources}")
+ if(MONO_CROSS_COMPILE_EXECUTABLE_NAME)
+ set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross)
+ endif()
target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS})
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
# if components are built statically, link them into runtime.
set_property(TARGET mono-sgen APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}")
endif()
install(TARGETS mono-sgen RUNTIME)
+ if(HOST_WIN32)
+ install(FILES $<TARGET_PDB_FILE:mono-sgen> DESTINATION bin OPTIONAL)
+ endif()
endif()
<_PublishFramework Include="$(TargetFrameworks)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
+ <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>
</Project>
<_PublishFramework Include="$(TargetFrameworks)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
+ <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>
</Project>
<_PublishFramework Include="$(TargetFrameworks)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
+ <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>
<_PublishFramework Include="$(TargetFrameworks)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
+ <FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>