@@ -63,12 +63,14 @@ MINIAUDIO_OPUS_INCLUDE_DIR = path.getabsolute("./miniaudio/extras/decoders/libop
6363MINIAUDIO_VORBIS_INCLUDE_DIR = path .getabsolute (" ./miniaudio/extras/decoders/libvorbis" )
6464
6565-- Read settings from command line or environment variables
66+ -- Default values should be defined at the top of the script. If any values are set in the premake options, GetParam will not
67+ -- read them from environment variables.
6668
6769newoption { trigger = " build-lua" , category = " YGOPro - lua" , description = " " }
6870newoption { trigger = " no-build-lua" , category = " YGOPro - lua" , description = " " }
6971newoption { trigger = " lua-include-dir" , category = " YGOPro - lua" , description = " " , value = " PATH" }
7072newoption { trigger = " lua-lib-dir" , category = " YGOPro - lua" , description = " " , value = " PATH" }
71- newoption { trigger = " lua-lib-name" , category = " YGOPro - lua" , description = " " , value = " NAME" , default = LUA_LIB_NAME }
73+ newoption { trigger = " lua-lib-name" , category = " YGOPro - lua" , description = " " , value = " NAME" }
7274
7375newoption { trigger = " build-event" , category = " YGOPro - event" , description = " " }
7476newoption { trigger = " no-build-event" , category = " YGOPro - event" , description = " " }
@@ -95,7 +97,7 @@ newoption { trigger = "build-jpeg", category = "YGOPro - jpeg", description = ""
9597newoption { trigger = " no-build-jpeg" , category = " YGOPro - jpeg" , description = " " }
9698newoption { trigger = " jpeg-include-dir" , category = " YGOPro - jpeg" , description = " " , value = " PATH" }
9799newoption { trigger = " jpeg-lib-dir" , category = " YGOPro - jpeg" , description = " " , value = " PATH" }
98- newoption { trigger = " jpeg-lib-name" , category = " YGOPro - jpeg" , description = " " , value = " NAME" , default = JPEG_LIB_NAME }
100+ newoption { trigger = " jpeg-lib-name" , category = " YGOPro - jpeg" , description = " " , value = " NAME" }
99101
100102newoption { trigger = " build-png" , category = " YGOPro - png" , description = " " }
101103newoption { trigger = " no-build-png" , category = " YGOPro - png" , description = " " }
@@ -106,10 +108,10 @@ newoption { trigger = "build-zlib", category = "YGOPro - zlib", description = ""
106108newoption { trigger = " no-build-zlib" , category = " YGOPro - zlib" , description = " " }
107109newoption { trigger = " zlib-include-dir" , category = " YGOPro - zlib" , description = " " , value = " PATH" }
108110newoption { trigger = " zlib-lib-dir" , category = " YGOPro - zlib" , description = " " , value = " PATH" }
109- newoption { trigger = " zlib-lib-name" , category = " YGOPro - zlib" , description = " " , value = " NAME" , default = ZLIB_LIB_NAME }
111+ newoption { trigger = " zlib-lib-name" , category = " YGOPro - zlib" , description = " " , value = " NAME" }
110112
111113newoption { trigger = " no-audio" , category = " YGOPro" , description = " " }
112- newoption { trigger = " audio-lib" , category = " YGOPro" , description = " " , value = " " , default = AUDIO_LIB }
114+ newoption { trigger = " audio-lib" , category = " YGOPro" , description = " " , value = " " }
113115
114116newoption { trigger = " miniaudio-support-opus-vorbis" , category = " YGOPro - miniaudio" , description = " " }
115117newoption { trigger = " no-miniaudio-support-opus-vorbis" , category = " YGOPro - miniaudio" , description = " " }
@@ -129,7 +131,7 @@ newoption { trigger = "mac-intel", category = "YGOPro", description = "Cross Com
129131
130132newoption { trigger = " use-openmp" , category = " YGOPro" , description = " Enable OpenMP support (edge case)" }
131133
132- newoption { trigger = " use-simd" , category = " YGOPro" , description = " " , value = " none, sse2, avx2, neon, best" , default = " best " }
134+ newoption { trigger = " use-simd" , category = " YGOPro" , description = " " , value = " none, sse2, avx2, neon, best" }
133135
134136function GetParam (param )
135137 return _OPTIONS [param ] or os.getenv (string.upper (string.gsub (param ," -" ," _" )))
@@ -279,9 +281,7 @@ if USE_AUDIO then
279281 end
280282end
281283
282- if GetParam (" use-simd" ) then
283- USE_SIMD = GetParam (" use-simd" )
284- end
284+ USE_SIMD = GetParam (" use-simd" ) or USE_SIMD
285285
286286if not MAC_ARM and not MAC_INTEL and table .indexof ({ " x86" , " x86_64" , " ARM64" }, PREMAKE_ARCH ) == nil then
287287 print (" Warning: Detected architecture " .. PREMAKE_ARCH .. " seems not supported, trying to build anyway, SIMD will be disabled." )
0 commit comments