@@ -6,6 +6,7 @@ newoption {
66 allowed = {
77 { " x86" , " x86 32-bits" },
88 { " x64" , " x64 64-bits" },
9+ { " AnyCPU" , " Any CPU (.NET)" },
910 }
1011}
1112
@@ -23,6 +24,10 @@ function is_64_bits_mono_runtime()
2324end
2425
2526function target_architecture ()
27+ if _ACTION == " netcore" then
28+ return " AnyCPU"
29+ end
30+
2631 -- Default to 32-bit on Windows and Mono architecture otherwise.
2732 if explicit_target_architecture ~= nil then
2833 return explicit_target_architecture
@@ -50,8 +55,14 @@ if _ARGS[1] then
5055 builddir = path .getabsolute (" ./" .. _ARGS [1 ]);
5156end
5257
53- objsdir = path .join (builddir , " obj" , " %{cfg.buildcfg}_%{cfg.platform}" );
54- libdir = path .join (builddir , " lib" , " %{cfg.buildcfg}_%{cfg.platform}" );
58+ if _ACTION ~= " netcore" then
59+ objsdir = path .join (builddir , " obj" , " %{cfg.buildcfg}_%{cfg.platform}" );
60+ libdir = path .join (builddir , " lib" , " %{cfg.buildcfg}_%{cfg.platform}" );
61+ else
62+ objsdir = path .join (builddir , " obj" , " %{cfg.buildcfg}" );
63+ libdir = path .join (builddir , " lib" , " %{cfg.buildcfg}" );
64+ end
65+
5566gendir = path .join (builddir , " gen" );
5667
5768msvc_buildflags = { " /wd4267" }
@@ -121,11 +132,14 @@ function SetupManagedProject()
121132 dotnetframework " 4.6"
122133
123134 if not os .istarget (" macosx" ) then
124- filter { " action:vs*" }
135+ filter { " action:vs* or netcore " }
125136 location " ."
126137 filter {}
127138 end
128139
140+ filter { " action:netcore" }
141+ dotnetframework " netstandard2.0"
142+
129143 filter { " action:vs2013" }
130144 dotnetframework " 4.5"
131145
@@ -196,4 +210,16 @@ function UseCxx11ABI()
196210 return true
197211 end
198212 return false
199- end
213+ end
214+
215+ function EnableNativeProjects ()
216+ if _ACTION == " netcore" then
217+ return false
218+ end
219+
220+ if string .starts (_ACTION , " vs" ) and not os .ishost (" windows" ) then
221+ return false
222+ end
223+
224+ return true
225+ end
0 commit comments