summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/genie.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/genie.lua')
-rw-r--r--scripts/genie.lua132
1 files changed, 34 insertions, 98 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 3a6a2bfd38b..819b753e794 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -158,16 +158,6 @@ newoption {
}
newoption {
- trigger = "distro",
- description = "Choose distribution",
- allowed = {
- { "generic", "generic" },
- { "debian-stable", "debian-stable" },
- { "ubuntu-intrepid", "ubuntu-intrepid" },
- },
-}
-
-newoption {
trigger = "target",
description = "Building target",
}
@@ -570,21 +560,9 @@ configuration { "gmake or ninja" }
dofile ("toolchain.lua")
-if _OPTIONS["targetos"]=="windows" then
- configuration { "x64" }
- defines {
- "X64_WINDOWS_ABI",
- }
- configuration { }
-end
-
-- Avoid error when invoking genie --help.
if (_ACTION == nil) then return false end
--- define PTR64 if we are a 64-bit target
-configuration { "x64 or android-*64"}
- defines { "PTR64=1" }
-
-- define MAME_DEBUG if we are a debugging build
configuration { "Debug" }
defines {
@@ -702,24 +680,22 @@ else
}
end
-if _OPTIONS["NOASM"]=="1" then
+if _OPTIONS["NOASM"] == "1" then
defines {
"MAME_NOASM"
}
end
-if not _OPTIONS["FORCE_DRC_C_BACKEND"] then
- if _OPTIONS["BIGENDIAN"]~="1" then
- configuration { "x64" }
- defines {
- "NATIVE_DRC=drcbe_x64",
- }
- configuration { "x32" }
- defines {
- "NATIVE_DRC=drcbe_x86",
- }
- configuration { }
- end
+if _OPTIONS["FORCE_DRC_C_BACKEND"] then
+ configuration { }
+ defines {
+ "NATIVE_DRC=drcbe_c",
+ }
+elseif (_OPTIONS["PLATFORM"] == "x86") or (_OPTIONS["PLATFORM"] == "arm64") then
+ configuration { }
+ defines {
+ "ASMJIT_STATIC",
+ }
end
defines {
@@ -1035,29 +1011,23 @@ end
local version = str_to_version(_OPTIONS["gcc_version"])
if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then
- if version < 60000 then
- print("Clang version 6.0 or later needed")
+ if version < 70000 then
+ print("Clang version 7.0 or later needed")
os.exit(-1)
end
buildoptions {
"-fdiagnostics-show-note-include-stack",
+ "-Wno-error=tautological-compare",
"-Wno-cast-align",
"-Wno-constant-logical-operand",
"-Wno-extern-c-compat",
"-Wno-ignored-qualifiers",
"-Wno-pragma-pack", -- clang 6.0 complains when the packing change lifetime is not contained within a header file.
- "-Wno-tautological-compare",
"-Wno-unknown-attributes",
"-Wno-unknown-warning-option",
"-Wno-unused-value",
"-Wno-unused-const-variable",
}
- if (version < 70000) or ((version < 100001) and (_OPTIONS["targetos"] == 'macosx')) then
- buildoptions { -- clang 6.0 complains that [[maybe_unused]] is ignored for static data members
- "-Wno-error=ignored-attributes",
- "-Wno-error=unused-const-variable",
- }
- end
if ((version >= 100000) and (_OPTIONS["targetos"] ~= 'macosx')) or (version >= 120000) then
buildoptions {
"-Wno-xor-used-as-pow", -- clang 10.0 complains that expressions like 10 ^ 7 look like exponention
@@ -1069,8 +1039,8 @@ end
}
end
else
- if version < 70000 then
- print("GCC version 7.0 or later needed")
+ if version < 100300 then
+ print("GCC version 10.3 or later needed")
os.exit(-1)
end
buildoptions_cpp {
@@ -1082,23 +1052,11 @@ end
buildoptions {
"-Wno-error=unused-result", -- needed for fgets,fread on linux
-- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds)
- "-Wno-array-bounds",
+ "-Wno-error=array-bounds",
"-Wno-error=attributes", -- GCC fails to recognize some uses of [[maybe_unused]]
+ "-Wno-error=stringop-truncation", -- ImGui again
+ "-Wno-stringop-overflow", -- generates false positives when assigning an int rvalue to a u8 variable without an explicit cast
}
- if version < 100300 then
- buildoptions_cpp {
- "-flifetime-dse=1", -- GCC 10.2 and earlier take issue with Sol's get<std::optional<T> >() otherwise - possibly an issue with libstdc++ itself
- }
- end
- if version >= 80000 then
- buildoptions {
- "-Wno-stringop-truncation", -- ImGui again
- "-Wno-stringop-overflow", -- formats/victor9k_dsk.cpp bugs the compiler
- }
- buildoptions_cpp {
- "-Wno-class-memaccess", -- many instances in ImGui and BGFX
- }
- end
if version >= 110000 then
buildoptions {
"-Wno-nonnull", -- luaengine.cpp lambdas do not need "this" captured but GCC 11.1 erroneously insists
@@ -1119,12 +1077,6 @@ end
end
end
-if (_OPTIONS["PLATFORM"]=="alpha") then
- defines {
- "PTR64=1",
- }
-end
-
if (_OPTIONS["PLATFORM"]=="arm") then
buildoptions {
"-Wno-cast-align",
@@ -1135,21 +1087,6 @@ if (_OPTIONS["PLATFORM"]=="arm64") then
buildoptions {
"-Wno-cast-align",
}
- defines {
- "PTR64=1",
- }
-end
-
-if (_OPTIONS["PLATFORM"]=="riscv64") then
- defines {
- "PTR64=1",
- }
-end
-
-if (_OPTIONS["PLATFORM"]=="mips64") then
- defines {
- "PTR64=1",
- }
end
local subdir
@@ -1173,31 +1110,32 @@ configuration { "asmjs" }
"-std=c++17",
"-s EXCEPTION_CATCHING_ALLOWED=\"['_ZN15running_machine17start_all_devicesEv','_ZN12cli_frontend7executeEiPPc','_ZN8chd_file11open_commonEb','_ZN8chd_file13read_metadataEjjRNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE','_ZN8chd_file13read_metadataEjjRNSt3__26vectorIhNS0_9allocatorIhEEEE','_ZNK19netlist_mame_device19base_validity_checkER16validity_checker']\"",
}
+ defines {
+ "ASIO_HAS_PTHREADS",
+ }
linkoptions {
"-Wl,--start-group",
"-O" .. _OPTIONS["OPTIMIZE"],
"-s USE_SDL=2",
"-s USE_SDL_TTF=2",
- "--memory-init-file 0",
"-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=\"['\\$$ERRNO_CODES']\"",
"-s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__ZN15running_machine30emscripten_get_running_machineEv', '__ZN15running_machine17emscripten_get_uiEv', '__ZN15running_machine20emscripten_get_soundEv', '__ZN15mame_ui_manager12set_show_fpsEb', '__ZNK15mame_ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio', '_SDL_SendKeyboardKey', '__ZN15running_machine15emscripten_saveEPKc', '__ZN15running_machine15emscripten_loadEPKc', '__ZN15running_machine21emscripten_hard_resetEv', '__ZN15running_machine21emscripten_soft_resetEv', '__ZN15running_machine15emscripten_exitEv']\"",
"-s EXPORTED_RUNTIME_METHODS=\"['cwrap']\"",
"-s ERROR_ON_UNDEFINED_SYMBOLS=0",
- "-s USE_WEBGL2=1",
- "-s LEGACY_GL_EMULATION=1",
- "-s GL_UNSAFE_OPTS=0",
+ "-s STACK_SIZE=5MB",
+ "-s MAX_WEBGL_VERSION=2",
"--pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js",
"--post-js " .. _MAKE.esc(MAME_DIR) .. "scripts/resources/emscripten/emscripten_post.js",
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/chains@bgfx/chains",
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/effects@bgfx/effects",
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/shaders/essl@bgfx/shaders/essl",
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/bgfx@artwork/bgfx",
+ "--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/lut-default.png@artwork/lut-default.png",
"--embed-file " .. _MAKE.esc(MAME_DIR) .. "artwork/slot-mask.png@artwork/slot-mask.png",
}
if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then
linkoptions {
"-g" .. _OPTIONS["SYMLEVEL"],
- "-s DEMANGLE_SUPPORT=1",
}
end
if _OPTIONS["WEBASSEMBLY"] then
@@ -1213,11 +1151,12 @@ configuration { "asmjs" }
-- define a fixed memory size because allowing memory growth disables asm.js optimizations
linkoptions {
"-s ALLOW_MEMORY_GROWTH=0",
- "-s TOTAL_MEMORY=268435456",
+ "-s INITIAL_MEMORY=256MB",
}
else
linkoptions {
"-s ALLOW_MEMORY_GROWTH=1",
+ "-s INITIAL_MEMORY=24MB"
}
end
archivesplit_size "20"
@@ -1237,12 +1176,6 @@ configuration { "linux-*" }
flags {
"LinkSupportCircularDependencies",
}
- if _OPTIONS["distro"]=="debian-stable" then
- defines
- {
- "NO_AFFINITY_NP",
- }
- end
configuration { "freebsd or netbsd" }
@@ -1305,12 +1238,13 @@ configuration { "vs20*" }
}
buildoptions {
+ "/Zc:preprocessor",
+ "/utf-8",
+ "/permissive-",
"/w45038", -- warning C5038: data member 'member1' will be initialized after data member 'member2'
}
buildoptions {
- "/wd4003", -- warning C4003: not enough actual parameters for macro 'xxx'
- "/wd4005", -- warning C4005: The macro identifier is defined twice. The compiler uses the second macro definition
"/wd4018", -- warning C4018: 'x' : signed/unsigned mismatch
"/wd4060", -- warning C4060: switch statement contains no 'case' or 'default' labels
"/wd4065", -- warning C4065: switch statement contains 'default' but no 'case' labels
@@ -1322,6 +1256,7 @@ configuration { "vs20*" }
"/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
"/wd4250", -- warning C4250: 'xxx' : inherits 'xxx' via dominance
"/wd4267", -- warning C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data
+ "/wd4305", -- warning C4305: 'conversion': truncation from 'type1' to 'type2'
"/wd4310", -- warning C4310: cast truncates constant value
"/wd4319", -- warning C4319: 'operator' : zero extending 'type' to 'type' of greater size
"/wd4324", -- warning C4324: 'xxx' : structure was padded due to __declspec(align())
@@ -1332,10 +1267,11 @@ configuration { "vs20*" }
"/wd4458", -- warning C4458: declaration of 'xxx' hides class member
"/wd4459", -- warning C4459: declaration of 'xxx' hides global declaration
"/wd4611", -- warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
+ "/wd4646", -- warning C4646: function declared with 'noreturn' has non-void return type
+ "/wd4701", -- warning C4701: potentially uninitialized local variable 'name' used
"/wd4702", -- warning C4702: unreachable code
- "/wd4706", -- warning C4706: assignment within conditional expression
- "/wd4804", -- warning C4804: '>>': unsafe use of type 'bool' in operation
"/wd4805", -- warning C4805: 'x' : unsafe mix of type 'xxx' and type 'xxx' in operation
+ "/wd4806", -- warning C4806: 'operation': unsafe operation: no value of type 'type' promoted to type 'type' can equal the given constant
"/wd4996", -- warning C4996: 'function': was declared deprecated
}