Skip to content

Commit 7f63184

Browse files
Sergio0694jkotasMichalStrehovsky
authored
Enable building .dll if both 'CustomNativeMain' and 'NativeLib' are set (#103504)
* Build a .dll if 'CustomNativeMain' is set * Switch on 'NativeLib' instead for .exe args * Actually output a .dll if 'NativeLib' is set --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
1 parent 043ae8c commit 7f63184

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Windows.targets

+2-3
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,11 @@ The .NET Foundation licenses this file to you under the MIT license.
9292
<LinkerArg Condition="$(NativeDebugSymbols) == 'true'" Include="/DEBUG" />
9393
<!-- The runtime is not compatible with jump stubs inserted by incremental linking. -->
9494
<LinkerArg Include="/INCREMENTAL:NO" />
95-
<LinkerArg Condition="'$(LinkerSubsystem)' != ''" Include="/SUBSYSTEM:$(LinkerSubsystem)" />
96-
<LinkerArg Condition="'$(OutputType)' == 'WinExe' or '$(OutputType)' == 'Exe'" Include="/ENTRY:$(EntryPointSymbol) /NOEXP /NOIMPLIB" />
95+
<LinkerArg Condition="'$(NativeLib)' == '' and '$(LinkerSubsystem)' != ''" Include="/SUBSYSTEM:$(LinkerSubsystem)" />
96+
<LinkerArg Condition="'$(NativeLib)' == ''" Include="/ENTRY:$(EntryPointSymbol) /NOEXP /NOIMPLIB /STACK:$(IlcDefaultStackSize)" />
9797
<LinkerArg Include="/NATVIS:&quot;$(MSBuildThisFileDirectory)NativeAOT.natvis&quot;" />
9898
<LinkerArg Condition="'$(ControlFlowGuard)' == 'Guard'" Include="/guard:cf" />
9999
<LinkerArg Condition="'$(_targetArchitecture)' == 'x86'" Include="/safeseh" />
100-
<LinkerArg Condition="'$(OutputType)' == 'WinExe' or '$(OutputType)' == 'Exe'" Include="/STACK:$(IlcDefaultStackSize)" />
101100
<!-- Do not warn if someone declares UnmanagedCallersOnly with an entrypoint of 'DllGetClassObject' and similar -->
102101
<LinkerArg Include="/IGNORE:4104" />
103102
<!-- Opt into CETCOMPAT by default. -->

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The .NET Foundation licenses this file to you under the MIT license.
6262

6363
<IlcOutputFileExt Condition="$(IlcOutputFileExt) == ''">$(NativeObjectExt)</IlcOutputFileExt>
6464

65-
<IsNativeExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true</IsNativeExecutable>
65+
<IsNativeExecutable Condition="('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe') and '$(NativeLib)' == ''">true</IsNativeExecutable>
6666

6767
<NativeBinaryExt Condition="'$(IsNativeExecutable)' == 'true' and '$(_targetOS)' == 'win'">.exe</NativeBinaryExt>
6868
<NativeBinaryExt Condition="'$(IsNativeExecutable)' == 'true' and '$(_targetOS)' != 'win'"></NativeBinaryExt>

0 commit comments

Comments
 (0)