File tree Expand file tree Collapse file tree 5 files changed +11
-0
lines changed
Expand file tree Collapse file tree 5 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ historical reasons.
9999 Microsoft C/C++ extensions. Defaults to ` false ` , but note that the compiler
100100 itself always enables some parts of this when targeting Windows as Win32
101101 headers require it.
102+ * ` NoEntryPoint ` (` true ` , ` false ` ): Enable/disable the omission of an entry
103+ point function when building executables. Defaults to ` false ` .
102104* ` UnicodeEnvironment ` (` true ` , ` false ` ): Enable/disable compiling for a Unicode
103105 environment when targeting Windows in C/C++ projects. This causes the
104106 ` UNICODE ` and ` _UNICODE ` macros to be defined, and makes it so that
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ public int ImageBase
104104 [ Required ]
105105 public bool MicrosoftExtensions { get ; set ; }
106106
107+ [ Required ]
108+ public bool NoEntryPoint { get ; set ; }
109+
107110 [ Required ]
108111 public bool NullabilityAnalysis { get ; set ; }
109112
@@ -251,6 +254,9 @@ protected override string GenerateCommandLineCommands()
251254 if ( ! TargetTriple . StartsWith ( "wasm" , StringComparison . Ordinal ) )
252255 builder . AppendSwitch ( "-fPIE" ) ;
253256
257+ if ( NoEntryPoint )
258+ builder . AppendSwitch ( isZig ? "-fno-entry" : "-Wl,--no-entry" ) ;
259+
254260 if ( _symbolExports == ZigSymbolExports . All )
255261 builder . AppendSwitch ( "-rdynamic" ) ;
256262 }
Original file line number Diff line number Diff line change 7474 LinkerReferences =" @(LinkerReference)"
7575 LinkTimeOptimization =" $(LinkTimeOptimization)"
7676 MicrosoftExtensions =" $(MicrosoftExtensions)"
77+ NoEntryPoint =" $(NoEntryPoint)"
7778 NullabilityAnalysis =" $(NullabilityAnalysis)"
7879 OutputBinary =" @(IntermediateAssembly)"
7980 OutputType =" $(OutputType)"
Original file line number Diff line number Diff line change 3535 <CxxExceptions Condition =" '$(CxxExceptions)' == ''" >true</CxxExceptions >
3636 <CxxReflection Condition =" '$(CxxReflection)' == ''" >true</CxxReflection >
3737 <MicrosoftExtensions Condition =" '$(MicrosoftExtensions)' == ''" >false</MicrosoftExtensions >
38+ <NoEntryPoint Condition =" '$(NoEntryPoint)' == ''" >false</NoEntryPoint >
3839 <UnicodeEnvironment Condition =" '$(UnicodeEnvironment)' == ''" >false</UnicodeEnvironment >
3940 <ZigVersion Condition =" '$(ZigVersion)' == ''" >0.13.0</ZigVersion >
4041 </PropertyGroup >
Original file line number Diff line number Diff line change 4646 LinkerReferences =" @(LinkerReference)"
4747 LinkTimeOptimization =" $(LinkTimeOptimization)"
4848 MicrosoftExtensions =" $(MicrosoftExtensions)"
49+ NoEntryPoint =" $(NoEntryPoint)"
4950 NullabilityAnalysis =" $(NullabilityAnalysis)"
5051 OutputBinary =" @(TestAssembly)"
5152 OutputType =" $(OutputType)"
You can’t perform that action at this time.
0 commit comments