mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
Added lua script/makefile changes to support building tests and portaudio (nw)
This commit is contained in:
parent
ccc42edb39
commit
2e772fb160
6
makefile
6
makefile
@ -22,6 +22,7 @@
|
||||
# TARGET = mame
|
||||
# SUBTARGET = tiny
|
||||
# TOOLS = 1
|
||||
# TESTS = 1
|
||||
# OSD = sdl
|
||||
|
||||
# USE_BGFX = 1
|
||||
@ -375,6 +376,10 @@ ifdef TOOLS
|
||||
PARAMS += --with-tools
|
||||
endif
|
||||
|
||||
ifdef TESTS
|
||||
PARAMS += --with-tests
|
||||
endif
|
||||
|
||||
ifdef SYMBOLS
|
||||
PARAMS += --SYMBOLS='$(SYMBOLS)'
|
||||
endif
|
||||
@ -571,6 +576,7 @@ SCRIPTS = scripts/genie.lua \
|
||||
$(wildcard scripts/src/osd/$(OSD)*.lua) \
|
||||
scripts/src/sound.lua \
|
||||
scripts/src/tools.lua \
|
||||
scripts/src/tests.lua \
|
||||
scripts/src/video.lua \
|
||||
scripts/src/bus.lua \
|
||||
scripts/src/netlist.lua \
|
||||
|
@ -59,6 +59,11 @@ newoption {
|
||||
description = "Enable building tools.",
|
||||
}
|
||||
|
||||
newoption {
|
||||
trigger = "with-tests",
|
||||
description = "Enable building tests.",
|
||||
}
|
||||
|
||||
newoption {
|
||||
trigger = "osd",
|
||||
description = "Choose OSD layer implementation",
|
||||
@ -1138,3 +1143,7 @@ if _OPTIONS["with-tools"] then
|
||||
dofile(path.join("src", "tools.lua"))
|
||||
end
|
||||
|
||||
if _OPTIONS["with-tests"] then
|
||||
group "tests"
|
||||
dofile(path.join("src", "tests.lua"))
|
||||
end
|
||||
|
@ -604,3 +604,191 @@ project "bgfx"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------
|
||||
-- PortAudio library objects
|
||||
--------------------------------------------------
|
||||
|
||||
project "portaudio"
|
||||
uuid "0755c5f5-eccf-47f3-98a9-df67018a94d4"
|
||||
kind "StaticLib"
|
||||
|
||||
configuration { "gmake" }
|
||||
buildoptions_c {
|
||||
"-Wno-strict-prototypes",
|
||||
"-Wno-bad-function-cast",
|
||||
"-Wno-undef",
|
||||
"-Wno-missing-braces",
|
||||
"-Wno-unused-but-set-variable",
|
||||
"-Wno-maybe-uninitialized",
|
||||
"-Wno-unused-value",
|
||||
"-Wno-unused-function",
|
||||
}
|
||||
|
||||
configuration { "vs*" }
|
||||
buildoptions {
|
||||
"/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer
|
||||
"/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
|
||||
}
|
||||
|
||||
configuration { }
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/portaudio/include",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common",
|
||||
}
|
||||
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_allocation.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_converters.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_cpuload.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_dither.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_debugprint.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_front.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_process.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_stream.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_trace.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/skeleton/pa_hostapi_skeleton.c",
|
||||
}
|
||||
|
||||
if _OPTIONS["targetos"]=="windows" then
|
||||
defines {
|
||||
"PA_USE_DS=1",
|
||||
"PA_USE_WDMKS=1",
|
||||
"PA_USE_WMME=1",
|
||||
"PA_USE_WASAPI=1",
|
||||
}
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win",
|
||||
}
|
||||
configuration { "mingw*" }
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/wasapi/mingw-include",
|
||||
}
|
||||
configuration { }
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_util.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_waveformat.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_hostapis.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_x86_plain_converters.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_coinitialize.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/dsound/pa_win_ds.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/wdmks/pa_win_wdmks.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_ringbuffer.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/wmme/pa_win_wmme.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/wasapi/pa_win_wasapi.c",
|
||||
}
|
||||
|
||||
end
|
||||
if _OPTIONS["targetos"]=="linux" then
|
||||
defines {
|
||||
"PA_USE_ALSA=1",
|
||||
"PA_USE_OSS=1",
|
||||
"HAVE_LINUX_SOUNDCARD_H",
|
||||
}
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/unix",
|
||||
}
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_hostapis.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_util.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/oss/pa_unix_oss.c",
|
||||
}
|
||||
end
|
||||
if _OPTIONS["targetos"]=="macosx" then
|
||||
defines {
|
||||
"PA_USE_COREAUDIO=1",
|
||||
}
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/unix",
|
||||
}
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_hostapis.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_util.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c",
|
||||
MAME_DIR .. "3rdparty/portaudio/src/common/pa_ringbuffer.c",
|
||||
}
|
||||
end
|
||||
|
||||
if (_OPTIONS["SHADOW_CHECK"]=="1") then
|
||||
removebuildoptions {
|
||||
"-Wshadow"
|
||||
}
|
||||
end
|
||||
|
||||
--------------------------------------------------
|
||||
-- UnitTest++ library objects
|
||||
--------------------------------------------------
|
||||
|
||||
project "unittest-cpp"
|
||||
uuid "717d39e5-b6ff-4507-a092-c27c05b60ab5"
|
||||
kind "StaticLib"
|
||||
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/AssertException.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/AssertException.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/CheckMacros.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Checks.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Checks.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/CompositeTestReporter.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/CompositeTestReporter.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Config.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/CurrentTest.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/CurrentTest.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/ExceptionMacros.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/ExecuteTest.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/HelperMacros.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/MemoryOutStream.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/MemoryOutStream.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/ReportAssert.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/ReportAssert.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/ReportAssertImpl.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Test.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Test.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestDetails.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestDetails.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestList.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestList.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestMacros.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestReporter.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestReporter.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestReporterStdout.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestReporterStdout.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestResults.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestResults.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestRunner.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestRunner.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TestSuite.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TimeConstraint.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TimeConstraint.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/TimeHelpers.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/UnitTest++.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/UnitTestPP.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/XmlTestReporter.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/XmlTestReporter.h",
|
||||
}
|
||||
|
||||
if _OPTIONS["targetos"]~="windows" then
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Posix/SignalTranslator.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Posix/SignalTranslator.h",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Posix/TimeHelpers.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Posix/TimeHelpers.h",
|
||||
}
|
||||
end
|
||||
|
||||
if _OPTIONS["targetos"]=="windows" then
|
||||
files {
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Win32/TimeHelpers.cpp",
|
||||
MAME_DIR .. "3rdparty/unittest-cpp/UnitTest++/Win32/TimeHelpers.h",
|
||||
}
|
||||
end
|
||||
|
42
scripts/src/tests.lua
Normal file
42
scripts/src/tests.lua
Normal file
@ -0,0 +1,42 @@
|
||||
-- license:BSD-3-Clause
|
||||
-- copyright-holders:MAMEdev Team
|
||||
|
||||
--------------------------------------------------
|
||||
-- MAME tests
|
||||
--------------------------------------------------
|
||||
|
||||
project("tests")
|
||||
uuid ("66d4c639-196b-4065-a411-7ee9266564f5")
|
||||
kind "ConsoleApp"
|
||||
|
||||
options {
|
||||
"ForceCPP",
|
||||
}
|
||||
|
||||
flags {
|
||||
"Symbols", -- always include minimum symbols for executables
|
||||
}
|
||||
|
||||
if _OPTIONS["SEPARATE_BIN"]~="1" then
|
||||
targetdir(MAME_DIR)
|
||||
end
|
||||
|
||||
links {
|
||||
"unittest-cpp",
|
||||
"utils",
|
||||
"expat",
|
||||
"zlib",
|
||||
"ocore_" .. _OPTIONS["osd"],
|
||||
}
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/unittest-cpp",
|
||||
MAME_DIR .. "src/osd",
|
||||
MAME_DIR .. "src/lib/util",
|
||||
}
|
||||
|
||||
files {
|
||||
MAME_DIR .. "tests/main.c",
|
||||
MAME_DIR .. "tests/lib/util/corestr.c",
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user