diff options
Diffstat (limited to 'scripts/genie.lua')
-rw-r--r-- | scripts/genie.lua | 818 |
1 files changed, 551 insertions, 267 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index e5a6e782d8e..60539aca51b 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1,26 +1,17 @@ premake.check_paths = true premake.make.override = { "TARGET" } +premake.make.linkoptions_after = true MAME_DIR = (path.getabsolute("..") .. "/") local MAME_BUILD_DIR = (MAME_DIR .. "build/") local naclToolchain = "" -function includeosd() - includedirs { - MAME_DIR .. "src/osd", - } - if _OPTIONS["osd"]=="windows" then - includedirs { - MAME_DIR .. "src/osd/windows", - } - else - includedirs { - MAME_DIR .. "src/osd/sdl", - } - end +function backtick(cmd) + result = string.gsub(string.gsub(os.outputof(cmd), "\r?\n$", ""), " $", "") + return result end -function str_to_version (str) +function str_to_version(str) local val = 0 if (str == nil or str == '') then return val @@ -33,6 +24,26 @@ function str_to_version (str) return val end +function findfunction(x) + assert(type(x) == "string") + local f=_G + for v in x:gmatch("[^%.]+") do + if type(f) ~= "table" then + return nil, "looking for '"..v.."' expected table, not "..type(f) + end + f=f[v] + end + if type(f) == "function" then + return f + else + return nil, "expected function, not "..type(f) + end +end + +function layoutbuildtask(_folder, _name) + return { MAME_DIR .. "src/".._folder.."/".. _name ..".lay" , GEN_DIR .. _folder .. "/".._name..".lh", { MAME_DIR .. "src/build/file2str.py" }, {"@echo Converting src/".._folder.."/".._name..".lay...", PYTHON .. " $(1) $(<) $(@) layout_".._name }}; +end + CPUS = {} SOUNDS = {} MACHINES = {} @@ -42,30 +53,33 @@ BUSES = {} newoption { trigger = "with-tools", description = "Enable building tools.", -} +} newoption { trigger = "osd", - description = "Choose target OSD", - allowed = { - { "osdmini", "mini dummy OSD" }, - { "sdl", "SDL" }, - { "windows", "Windows" }, - }, + description = "Choose OSD layer implementation", } newoption { trigger = "targetos", description = "Choose target OS", allowed = { - { "android", "Android" }, - { "asmjs", "Emscripten/asm.js" }, - { "freebsd", "FreeBSD" }, - { "linux", "Linux" }, - { "ios", "iOS" }, - { "nacl", "Native Client" }, - { "macosx", "OSX" }, - { "windows", "Windows" }, + { "android-arm", "Android - ARM" }, + { "android-mips", "Android - MIPS" }, + { "android-x86", "Android - x86" }, + { "asmjs", "Emscripten/asm.js" }, + { "freebsd", "FreeBSD" }, + { "netbsd", "NetBSD" }, + { "openbsd", "OpenBSD" }, + { "nacl", "Native Client" }, + { "nacl-arm", "Native Client - ARM" }, + { "pnacl", "Native Client - PNaCl" }, + { "linux", "Linux" }, + { "ios", "iOS" }, + { "macosx", "OSX" }, + { "windows", "Windows" }, + { "os2", "OS/2 eComStation" }, + { "haiku", "Haiku" }, }, } @@ -76,10 +90,6 @@ newoption { { "generic", "generic" }, { "debian-stable", "debian-stable" }, { "ubuntu-intrepid", "ubuntu-intrepid" }, - { "gcc44-generic", "gcc44-generic" }, - { "gcc45-generic", "gcc45-generic" }, - { "gcc46-generic", "gcc46-generic" }, - { "gcc47-generic", "gcc47-generic" }, }, } @@ -99,12 +109,6 @@ newoption { } newoption { - trigger = "os_version", - description = "OS version", - value = "", -} - -newoption { trigger = "CC", description = "CC replacement", } @@ -122,43 +126,184 @@ newoption { newoption { trigger = "PROFILE", description = "Enable profiling.", -} +} newoption { trigger = "SYMBOLS", description = "Enable symbols.", -} +} newoption { trigger = "SYMLEVEL", description = "Symbols level.", -} +} newoption { trigger = "PROFILER", description = "Include the internal profiler.", -} +} newoption { trigger = "OPTIMIZE", description = "Optimization level.", -} +} newoption { trigger = "ARCHOPTS", description = "ARCHOPTS.", -} +} + +newoption { + trigger = "LDOPTS", + description = "Additional linker options", +} newoption { trigger = "MAP", description = "Generate a link map.", -} +} + +newoption { + trigger = "NOASM", + description = "Disable implementations based on assembler code", + allowed = { + { "0", "Enable assembler code" }, + { "1", "Disable assembler code" }, + }, +} + +newoption { + trigger = "BIGENDIAN", + description = "Build for big endian target", + allowed = { + { "0", "Little endian target" }, + { "1", "Big endian target" }, + }, +} + +newoption { + trigger = "FORCE_DRC_C_BACKEND", + description = "Force DRC C backend.", +} + +newoption { + trigger = "NOWERROR", + description = "NOWERROR", +} + +newoption { + trigger = "USE_BGFX", + description = "Use of BGFX.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "DEPRECATED", + description = "Generate deprecation warnings during compilation.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "LTO", + description = "Clang link time optimization.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "SSE2", + description = "SSE2 optimized code and SSE2 code generation.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "OPENMP", + description = "OpenMP optimized code.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "CPP11", + description = "Compile c++ code as C++11.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "FASTDEBUG", + description = "Fast DEBUG.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "FILTER_DEPS", + description = "Filter dependency files.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "SEPARATE_BIN", + description = "Use separate bin folders.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +newoption { + trigger = "PYTHON_EXECUTABLE", + description = "Python executable.", +} + +PYTHON = "python" + +if _OPTIONS["PYTHON_EXECUTABLE"]~=nil then + PYTHON = _OPTIONS["PYTHON_EXECUTABLE"] +end + +if not _OPTIONS["BIGENDIAN"] then + _OPTIONS["BIGENDIAN"] = "0" +end + +if not _OPTIONS["NOASM"] then + if _OPTIONS["targetos"]=="emscripten" then + _OPTIONS["NOASM"] = "1" + else + _OPTIONS["NOASM"] = "0" + end +end + +if _OPTIONS["NOASM"]=="1" and not _OPTIONS["FORCE_DRC_C_BACKEND"] then + _OPTIONS["FORCE_DRC_C_BACKEND"] = "1" +end -local os_version = str_to_version(_OPTIONS["os_version"]) USE_BGFX = 1 -if (_OPTIONS["targetos"]=="macosx" and os_version < 100700) then - USE_BGFX = 0 +if(_OPTIONS["USE_BGFX"]~=nil) then + USE_BGFX = tonumber(_OPTIONS["USE_BGFX"]) end + GEN_DIR = MAME_BUILD_DIR .. "generated/" if (_OPTIONS["target"] == nil) then return false end @@ -168,42 +313,84 @@ if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then solution (_OPTIONS["target"]) else solution (_OPTIONS["target"] .. _OPTIONS["subtarget"]) -end - configurations { - "Debug", - "Release", - } +end + +configurations { + "Debug", + "Release", +} - platforms { - "x32", - "x64", - "Native", -- for targets where bitness is not specified +platforms { + "x32", + "x64", + "Native", -- for targets where bitness is not specified +} + +language "C++" + +flags { + "StaticRuntime", + "NoPCH", +} + +configuration { "vs*" } + flags { + "ExtraWarnings", } + if not _OPTIONS["NOWERROR"] then + flags{ + "FatalWarnings", + } + end - language "C++" +configuration { "Debug", "vs*" } flags { - "StaticRuntime", - "Unicode", - "NoPCH", + "Symbols", } - configuration { "vs*" } +configuration { "Release", "vs*" } flags { - "ExtraWarnings", - "FatalWarnings", + "Optimize", } - configuration { "Debug", "vs*" } - flags { - "Symbols", - } - configuration {} - -msgcompile ("Compiling $(subst ../../../,,$<)...") -msgcompile_objc ("Objective-C compiling $(subst ../../../,,$<)...") +configuration {} + +local AWK = "" +if (os.is("windows")) then + AWK_TEST = backtick("awk --version 2> NUL") + if (AWK_TEST~='') then + AWK = "awk" + else + AWK_TEST = backtick("gawk --version 2> NUL") + if (AWK_TEST~='') then + AWK = "gawk" + end + end +else + AWK_TEST = backtick("awk --version 2> /dev/null") + if (AWK_TEST~='') then + AWK = "awk" + else + AWK_TEST = backtick("gawk --version 2> /dev/null") + if (AWK_TEST~='') then + AWK = "gawk" + end + end +end + +if (_OPTIONS["FILTER_DEPS"]=="1") and (AWK~='') then + postcompiletasks { + AWK .. " -f ../../../../../scripts/depfilter.awk $(@:%.o=%.d) > $(@:%.o=%.dep)", + "mv $(@:%.o=%.dep) $(@:%.o=%.d)", + } +end -msgresource ("Compiling resources $(subst ../../../,,$<)...") +msgcompile ("Compiling $(subst ../,,$<)...") + +msgcompile_objc ("Objective-C compiling $(subst ../,,$<)...") + +msgresource ("Compiling resources $(subst ../,,$<)...") msglinking ("Linking $(notdir $@)...") @@ -215,7 +402,7 @@ if (not os.isfile(path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] . error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") end dofile (path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua")) - + configuration { "gmake" } flags { "SingleOutputDir", @@ -232,19 +419,19 @@ configuration { "x64", "Debug" } if _OPTIONS["PROFILE"] then targetsuffix "64dp" end - + configuration { "x32", "Release" } targetsuffix "" if _OPTIONS["PROFILE"] then targetsuffix "p" end - + configuration { "x32", "Debug" } targetsuffix "d" if _OPTIONS["PROFILE"] then targetsuffix "dp" end - + configuration { "Native", "Release" } targetsuffix "" if _OPTIONS["PROFILE"] then @@ -262,14 +449,12 @@ configuration { } dofile ("toolchain.lua") -if _OPTIONS["osd"]=="windows" then - forcedincludes { - MAME_DIR .. "src/osd/windows/winprefix.h" - } -elseif _OPTIONS["osd"]=="sdl" then - forcedincludes { - MAME_DIR .. "src/osd/sdl/sdlprefix.h" - } +if _OPTIONS["targetos"]=="windows" then + configuration { "x64" } + defines { + "X64_WINDOWS_ABI", + } + configuration { } end -- Avoid error when invoking genie --help. @@ -287,6 +472,11 @@ configuration { "gmake" } buildoptions_objc { "-DINLINE=\"static inline\"", } +configuration { "xcode4*" } + buildoptions { + "-DINLINE=\"static inline\"", + } + configuration { "vs*" } defines { "INLINE=static inline", @@ -296,12 +486,21 @@ configuration { "vs*" } configuration { "Debug" } defines { "MAME_DEBUG", + "MAME_PROFILER", } - if _OPTIONS["PROFILER"] then - defines{ - "MAME_PROFILER", -- define MAME_PROFILER if we are a profiling build - } - end +if _OPTIONS["FASTDEBUG"]=="1" then + defines { + "MAME_DEBUG_FAST" + } +end + +configuration { } + +if _OPTIONS["PROFILER"]=="1" then + defines{ + "MAME_PROFILER", -- define MAME_PROFILER if we are a profiling build + } +end configuration { "Release" } defines { @@ -309,43 +508,101 @@ configuration { "Release" } } configuration { } - -- CR/LF setup: use both on win32/os2, CR only on everything else - if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="os2" then + +-- CR/LF setup: use both on win32/os2, CR only on everything else +if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="os2" then + defines { + "CRLF=3", + } +else + defines { + "CRLF=2", + } +end + + +if _OPTIONS["BIGENDIAN"]=="1" then + if _OPTIONS["targetos"]=="macosx" then defines { - "CRLF=3", + "OSX_PPC", } - else - defines { - "CRLF=2", + buildoptions { + "-Wno-unused-label", } + if _OPTIONS["SYMBOLS"] then + buildoptions { + "-mlong-branch", + } + end + configuration { "x64" } + buildoptions { + "-arch ppc64", + } + linkoptions { + "-arch ppc64", + } + configuration { "x32" } + buildoptions { + "-arch ppc", + } + linkoptions { + "-arch ppc", + } + configuration { } end - - - -- define LSB_FIRST if we are a little-endian target +else defines { "LSB_FIRST", } - - -- define USE_NETWORK if networking is enabled (not OS/2 and hasn't been disabled) - if not _OPTIONS["targetos"]=="os2" then - defines { - "USE_NETWORK", - } + if _OPTIONS["targetos"]=="macosx" then + configuration { "x64" } + buildoptions { + "-arch x86_64", + } + linkoptions { + "-arch x86_64", + } + configuration { "x32" } + buildoptions { + "-arch i386", + } + linkoptions { + "-arch i386", + } + configuration { } end - -- need to ensure FLAC functions are statically linked +end + +-- need to ensure FLAC functions are statically linked +defines { + "FLAC__NO_DLL", +} + +if _OPTIONS["NOASM"]=="1" then defines { - "FLAC__NO_DLL", + "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 +end -- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used --ifneq ($(BUILD_JPEGLIB),1) --DEFS += -DUSE_SYSTEM_JPEGLIB --endif ---ifdef FASTDEBUG ---DEFS += -DMAME_DEBUG_FAST ---endif - --To support casting in Lua 5.3 defines { "LUA_COMPAT_APIINTCASTS", @@ -358,18 +615,24 @@ configuration { } "-std=gnu89", } + +if _OPTIONS["CPP11"]=="1" then + buildoptions_cpp { + "-x c++", + "-std=gnu++11", + } +else --we compile C++ code to C++98 standard with GNU extensions buildoptions_cpp { "-x c++", "-std=gnu++98", } +end buildoptions_objc { "-x objective-c++", } ---ifdef CPP11 ---CPPONLYFLAGS += -x c++ -std=gnu++11 ---else + -- this speeds it up a bit by piping between the preprocessor/compiler/assembler if not ("pnacl" == _OPTIONS["gcc"]) then @@ -400,11 +663,11 @@ if _OPTIONS["VERBOSE"] then end -- only show deprecation warnings when enabled ---ifndef DEPRECATED +if _OPTIONS["DEPRECATED"]~="1" then buildoptions { "-Wno-deprecated-declarations" } ---endif +end -- add profiling information for the compiler if _OPTIONS["PROFILE"] then @@ -419,7 +682,7 @@ end if _OPTIONS["SYMBOLS"]~=nil then flags { "Symbols", - } + } end --# add the optimization flag @@ -429,53 +692,68 @@ end } -- add the error warning flag - --ifndef NOWERROR +if _OPTIONS["NOWERROR"]==nil then buildoptions { "-Werror", } - +end -- if we are optimizing, include optimization options ---ifneq ($(),0) if _OPTIONS["OPTIMIZE"] then buildoptions { - "-fno-strict-aliasing" + "-fno-strict-aliasing" } - if _OPTIONS["ARCHOPTS"] then + if _OPTIONS["ARCHOPTS"] then buildoptions { _OPTIONS["ARCHOPTS"] } end ---ifdef LTO ---CCOMFLAGS += -flto ---endif + if _OPTIONS["LTO"]=="1" then + buildoptions { + "-flto", + } + linkoptions { + "-flto", + } + end end ---ifdef SSE2 ---CCOMFLAGS += -msse2 ---endif +if _OPTIONS["SSE2"]=="1" then + buildoptions { + "-msse2", + } +end ---ifdef OPENMP ---CCOMFLAGS += -fopenmp ---else ---CCOMFLAGS += -Wno-unknown-pragmas ---endif +if _OPTIONS["OPENMP"]=="1" then + buildoptions { + "-fopenmp", + } +else + buildoptions { + "-Wno-unknown-pragmas", + } +end + +if _OPTIONS["LDOPTS"] then + linkoptions { + _OPTIONS["LDOPTS"] + } +end if _OPTIONS["MAP"] then if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then linkoptions { - "-Wl,-Map," .. "../../../" .. _OPTIONS["target"] .. ".map" + "-Wl,-Map," .. "../../../../" .. _OPTIONS["target"] .. ".map" } else linkoptions { - "-Wl,-Map," .. "../../../" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".map" + "-Wl,-Map," .. "../../../../" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".map" } - end + end end - buildoptions { - "-Wno-unknown-pragmas", - } + + -- add a basic set of warnings buildoptions { "-Wall", @@ -512,7 +790,7 @@ end --endif - + local version = str_to_version(_OPTIONS["gcc_version"]) if string.find(_OPTIONS["gcc"], "clang") then buildoptions { @@ -521,7 +799,11 @@ end "-Wno-dynamic-class-memaccess", "-Wno-self-assign-field", } - + if (version >= 30200) then + buildoptions { + "-Wno-unused-value", + } + end if (version >= 30400) then buildoptions { "-Wno-inline-new-delete", @@ -536,11 +818,16 @@ end } end else + if (version == 40201) then + buildoptions { + "-Wno-cast-align" + } + end if (version >= 40400) then buildoptions { "-Wno-unused-result", } - end + end if (version >= 40700) then buildoptions { @@ -561,10 +848,17 @@ end -- CCOMFLAGS += -Wno-cast-align --endif -if not toolchain(MAME_BUILD_DIR) then +local subdir +if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then + subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] +else + subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] +end + +if not toolchain(MAME_BUILD_DIR, subdir) then return -- no action specified end - + configuration { "asmjs" } buildoptions { "-std=gnu89", @@ -602,29 +896,11 @@ configuration { "nacl*" } archivesplit_size "20" configuration { "linux-*" } - linkoptions { - "`sdl2-config --libs`", - } links { - "pthread", - "SDL2", - "SDL2_ttf", - "asound", "dl", - "fontconfig", - "freetype", - "GL", - "m", - "util", - "X11", - "Xinerama", - } - defines - { - "DISTRO=" .. _OPTIONS["distro"] , } if _OPTIONS["distro"]=="debian-stable" then - defines + defines { "NO_AFFINITY_NP", } @@ -633,57 +909,28 @@ configuration { "linux-*" } configuration { "osx*" } links { - "Cocoa.framework", - "OpenGL.framework", - "CoreAudio.framework", - "CoreMIDI.framework", - "SDL2.framework", "pthread", } + flags { + "Symbols", + } configuration { "mingw*" } - defines { - "main=utf8_main", - } linkoptions { "-static-libgcc", "-static-libstdc++", - "-municode", } - if _OPTIONS["osd"]=="sdl" then - linkoptions { - "-Wl,--allow-multiple-definition", - "-static" - } - links { - "opengl32", - "SDL2", - "Imm32", - "version", - "ole32", - "oleaut32", - } - end links { "user32", - "gdi32", - "dsound", - "dxguid", "winmm", "advapi32", - "comctl32", "shlwapi", "wsock32", - "dinput8", - "comdlg32", } configuration { "vs*" } defines { - "main=utf8_main", - } - defines { "XML_STATIC", "WIN32", "_WIN32", @@ -692,80 +939,108 @@ configuration { "vs*" } } links { "user32", - "gdi32", - "dsound", - "dxguid", "winmm", "advapi32", - "comctl32", "shlwapi", "wsock32", - "dinput8", - "comdlg32", } buildoptions { - "/wd4025", - "/wd4003", - "/wd4018", - "/wd4061", - "/wd4100", - "/wd4127", - "/wd4131", - "/wd4141", - "/wd4146", - "/wd4150", - "/wd4189", - "/wd4191", - "/wd4201", - "/wd4232", - "/wd4242", - "/wd4244", - "/wd4250", - "/wd4255", - "/wd4296", - "/wd4306", - "/wd4310", - "/wd4312", - "/wd4324", - "/wd4347", - "/wd4435", - "/wd4510", - "/wd4512", - "/wd4514", - "/wd4571", - "/wd4610", - "/wd4611", - "/wd4619", - "/wd4625", - "/wd4626", - "/wd4640", - "/wd4668", - "/wd4702", - "/wd4706", - "/wd4710", - "/wd4711", - "/wd4805", - "/wd4820", - "/wd4826", - "/wd4365", - "/wd4389", - "/wd4245", - "/wd4388", - "/wd4267", - "/wd4005", - "/wd4350", - "/wd4996", - "/wd4191", - "/wd4060", - "/wd4065", - "/wd4640", - "/wd4290", - "/wd4355", - "/wd4800", - "/wd4371", - "/wd4548", + "/wd4025", -- warning C4025: 'number' : based pointer passed to function with variable arguments: parameter number + "/wd4003", -- warning C4003: not enough actual parameters for macro 'xxx' + "/wd4018", -- warning C4018: 'x' : signed/unsigned mismatch + "/wd4061", -- warning C4061: enumerator 'xxx' in switch of enum 'xxx' is not explicitly handled by a case label + "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter + "/wd4127", -- warning C4127: conditional expression is constant + "/wd4131", -- warning C4131: 'xxx' : uses old-style declarator + "/wd4141", -- warning C4141: 'xxx' : used more than once + "/wd4146", -- warning C4146: unary minus operator applied to unsigned type, result still unsigned + "/wd4150", -- warning C4150: deletion of pointer to incomplete type 'xxx'; no destructor called + "/wd4189", -- warning C4189: 'xxx' : local variable is initialized but not referenced + "/wd4191", -- warning C4191: 'type cast' : unsafe conversion from 'xxx' to 'xxx' // 64-bit only + "/wd4201", -- warning C4201: nonstandard extension used : nameless struct/union + "/wd4232", -- warning C4232: nonstandard extension used : 'xxx' : address of dllimport 'xxx' is not static, identity not guaranteed + "/wd4242", -- warning C4242: 'x' : conversion from 'xxx' to 'xxx', possible loss of data + "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data + "/wd4250", -- warning C4250: 'xxx' : inherits 'xxx' via dominance + "/wd4255", -- warning C4255: 'xxx' : no function prototype given: converting '()' to '(void)' + "/wd4296", -- warning C4296: 'x' : expression is always false + "/wd4306", -- warning C4306: 'xxx': conversion from 'type1' to 'type2' of greater size // 64-bit only + "/wd4310", -- warning C4310: cast truncates constant value + "/wd4312", -- warning C4312: 'type cast' : conversion from 'xxx' to 'xxx' of greater size + "/wd4324", -- warning C4324: 'xxx' : structure was padded due to __declspec(align()) + "/wd4347", -- warning C4347: behavior change: 'xxx' is called instead of 'xxx' // obsolete VS2005 - VS2010 only + "/wd4435", -- warning C4435: 'xxx' : Object layout under /vd2 will change due to virtual base 'xxx' + "/wd4510", -- warning C4510: 'xxx' : default constructor could not be generated + "/wd4512", -- warning C4512: 'xxx' : assignment operator could not be generated + "/wd4514", -- warning C4514: 'xxx' : unreferenced inline function has been removed + "/wd4571", -- warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable + "/wd4610", -- warning C4619: #pragma warning : there is no warning number 'xxx' + "/wd4611", -- warning C4571: Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught + "/wd4619", -- warning C4610: struct 'xxx' can never be instantiated - user defined constructor required + "/wd4625", -- warning C4625: 'xxx' : copy constructor could not be generated because a base class copy constructor is inaccessible or deleted + "/wd4626", -- warning C4626: 'xxx' : assignment operator could not be generated because a base class assignment operator is inaccessible or deleted + "/wd4640", -- warning C4640: 'xxx' : construction of local static object is not thread-safe + "/wd4668", -- warning C4668: 'xxx' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + "/wd4702", -- warning C4702: unreachable code + "/wd4706", -- warning C4706: assignment within conditional expression + "/wd4710", -- warning C4710: 'xxx' : function not inlined + "/wd4711", -- warning C4711: function 'xxx' selected for automatic inline expansion // optimized only + "/wd4805", -- warning C4805: 'x' : unsafe mix of type 'xxx' and type 'xxx' in operation + "/wd4820", -- warning C4820: 'xxx' : 'x' bytes padding added after data member 'xxx' + "/wd4826", -- warning C4826: Conversion from 'type1 ' to 'type_2' is sign-extended. This may cause unexpected runtime behavior. // 32-bit only + "/wd4365", -- warning C4365: 'action' : conversion from 'type_1' to 'type_2', signed/unsigned mismatch + "/wd4389", -- warning C4389: 'operator' : signed/unsigned mismatch + "/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch + "/wd4388", -- warning C4388: + "/wd4267", -- warning C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data + "/wd4005", -- warning C4005: The macro identifier is defined twice. The compiler uses the second macro definition + "/wd4350", -- warning C4350: behavior change: 'member1' called instead of 'member2' + "/wd4996", -- warning C4996: 'function': was declared deprecated + "/wd4191", -- warning C4191: 'operator/operation' : unsafe conversion from 'type of expression' to 'type required' + "/wd4060", -- warning C4060: switch statement contains no 'case' or 'default' labels + "/wd4065", -- warning C4065: switch statement contains 'default' but no 'case' labels + "/wd4640", -- warning C4640: 'instance' : construction of local static object is not thread-safe + "/wd4290", -- warning C4290: + "/wd4355", -- warning C4355: 'this' : used in base member initializer list + "/wd4800", -- warning C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) + "/wd4371", -- warning C4371: + "/wd4548", -- warning C4548: expression before comma has no effect; expected expression with side-effect } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd9", -- remark #9: nested comment is not allowed + "/Qwd82", -- remark #82: storage class is not first + "/Qwd111", -- remark #111: statement is unreachable + "/Qwd128", -- remark #128: loop is not reachable + "/Qwd177", -- remark #177: function "xxx" was declared but never referenced + "/Qwd181", -- remark #181: argument of type "UINT32={unsigned int}" is incompatible with format "%d", expecting argument of type "int" + "/Qwd185", -- remark #185: dynamic initialization in unreachable code + "/Qwd280", -- remark #280: selector expression is constant + "/Qwd344", -- remark #344: typedef name has already been declared (with same type) + "/Qwd411", -- remark #411: class "xxx" defines no constructor to initialize the following + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + "/Qwd2545", -- remark #2545: empty dependent statement in "else" clause of if - statement + "/Qwd2553", -- remark #2553: nonstandard second parameter "TCHAR={WCHAR = { __wchar_t } } **" of "main", expected "char *[]" or "char **" extern "C" int _tmain(int argc, TCHAR **argv) + "/Qwd2557", -- remark #2557: comparison between signed and unsigned operands + "/Qwd3280", -- remark #3280: declaration hides member "attotime::seconds" (declared at line 126) static attotime from_seconds(INT32 seconds) { return attotime(seconds, 0); } + + "/Qwd170", -- error #170: pointer points outside of underlying object + "/Qwd188", -- error #188: enumerated type mixed with another type + + "/Qwd63", -- warning #63: shift count is too large + "/Qwd177", -- warning #177: label "xxx" was declared but never referenced + "/Qwd186", -- warning #186: pointless comparison of unsigned integer with zero + "/Qwd488", -- warning #488: template parameter "_FunctionClass" is not used in declaring the parameter types of function template "device_delegate<_Signature>::device_delegate<_FunctionClass>(delegate<_Signature>: + "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated + "/Qwd1879", -- warning #1879: unimplemented pragma ignored + "/Qwd3291", -- warning #3291: invalid narrowing conversion from "double" to "int" + "/Qwd1195", + "/Qwd1786", + "/Qwd592", -- For lua, false positive? + } +end + linkoptions { "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library } @@ -785,25 +1060,34 @@ configuration { "x64", "vs*" } configuration { } + group "libs" -dofile(path.join("src", "3rdparty.lua")) + +if (not os.isfile(path.join("src", "osd", _OPTIONS["osd"] .. ".lua"))) then + error("Unsupported value '" .. _OPTIONS["osd"] .. "' for OSD") +end +dofile(path.join("src", "osd", _OPTIONS["osd"] .. ".lua")) dofile(path.join("src", "lib.lua")) +group "3rdparty" +dofile(path.join("src", "3rdparty.lua")) + + group "core" -dofile(path.join("src", "osd.lua")) dofile(path.join("src", "emu.lua")) emuProject(_OPTIONS["target"],_OPTIONS["subtarget"]) group "drivers" -createProjects(_OPTIONS["target"],_OPTIONS["subtarget"]) +findfunction("createProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"]) + group "emulator" dofile(path.join("src", "main.lua")) if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then startproject (_OPTIONS["target"]) else startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"]) -end +end mainProject(_OPTIONS["target"],_OPTIONS["subtarget"]) if _OPTIONS["with-tools"] then @@ -811,6 +1095,6 @@ if _OPTIONS["with-tools"] then dofile(path.join("src", "tools.lua")) end -if (_ACTION == "gmake" and _OPTIONS["gcc"]=='asmjs') then +if (_ACTION == "gmake" and _OPTIONS["gcc"]=='asmjs') then strip() end |