Skip to content

Commit 4f87ad9

Browse files
committed
Minimize tools-only build
Avoid unnecessary work and dependencies when building tools and no emulator. * makefile: Skip compressing layouts and converting translations if the emulator isn't being built. * scripts/src/3rdparty.lua: Make libraries not needed by tools conditional on the 'with-emulator' genie option. * scripts/src/osd/modules.lua: Refactor module file inclusion to optionally omit implementations other than 'none', as tools don't depend on modules. * scripts/src/{cpu,devices}.lua: Refactor CPU core file inclusion to collect these similarly to the disassembler files and only build the 'optional' project including them if the emulator is being built. * Make 'qtdbg' projects conditional on USE_QTDEBUG to avoid warnings when Qt libraries aren't present, as tools don't need them.
1 parent 993d404 commit 4f87ad9

File tree

9 files changed

+310
-206
lines changed

9 files changed

+310
-206
lines changed

makefile

+26
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# NO_USE_XINPUT = 1
4242
# NO_USE_XINPUT_WII_LIGHTGUN_HACK = 1
4343
# FORCE_DRC_C_BACKEND = 1
44+
# NO_MODULE_IMPLS = 1
4445

4546
# DEBUG = 1
4647
# PROFILER = 1
@@ -496,6 +497,23 @@ OSD := sdl
496497
endif
497498
endif
498499

500+
#-------------------------------------------------
501+
# auto-disable unnecessary features if the
502+
# emulator isn't going to be built
503+
#-------------------------------------------------
504+
ifdef EMULATOR
505+
ifeq '$(EMULATOR)' '0'
506+
NO_X11 = 1
507+
NO_OPENGL = 1
508+
USE_WAYLAND = 0
509+
USE_QTDEBUG = 0
510+
NO_USE_MIDI = 1
511+
NO_USE_PORTAUDIO = 1
512+
NO_USE_PULSEAUDIO = 1
513+
NO_MODULE_IMPLS = 1
514+
endif
515+
endif
516+
499517
#-------------------------------------------------
500518
# which 3rdparty library to build;
501519
# link against system (common) library otherwise
@@ -769,6 +787,10 @@ ifdef USE_DISPATCH_GL
769787
PARAMS += --USE_DISPATCH_GL='$(USE_DISPATCH_GL)'
770788
endif
771789

790+
ifdef NO_MODULE_IMPLS
791+
PARAMS += --NO_MODULE_IMPLS='$(NO_MODULE_IMPLS)'
792+
endif
793+
772794
ifdef NO_USE_MIDI
773795
PARAMS += --NO_USE_MIDI='$(NO_USE_MIDI)'
774796
endif
@@ -1554,12 +1576,16 @@ $(GEN_FOLDERS):
15541576

15551577
genie: $(GENIE)
15561578

1579+
ifneq '$(EMULATOR)' '0'
15571580
generate: \
15581581
genie \
15591582
$(GEN_FOLDERS) \
15601583
$(GENDIR)/version.cpp \
15611584
$(patsubst %.po,%.mo,$(call rwildcard, language/, *.po)) \
15621585
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS))
1586+
else
1587+
generate: genie $(GENDIR)/version.cpp
1588+
endif
15631589

15641590
ifneq ($(NEW_GIT_VERSION),$(OLD_GIT_VERSION))
15651591
stale:

scripts/src/3rdparty.lua

+21-3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ end
228228
-- SoftFloat library objects
229229
--------------------------------------------------
230230

231+
if _OPTIONS["with-emulator"] then
231232
project "softfloat"
232233
uuid "04fbf89e-4761-4cf2-8a12-64500cf0c5c5"
233234
kind "StaticLib"
@@ -265,12 +266,14 @@ end
265266
MAME_DIR .. "3rdparty/softfloat/fyl2x.c",
266267
MAME_DIR .. "3rdparty/softfloat/f2xm1.c",
267268
}
269+
end
268270

269271

270272
--------------------------------------------------
271273
-- SoftFloat 3 library objects
272274
--------------------------------------------------
273275

276+
if _OPTIONS["with-emulator"] then
274277
project "softfloat3"
275278
uuid "9c22fc90-53fd-11e8-b566-0800200c9a66"
276279
kind "StaticLib"
@@ -629,13 +632,14 @@ end
629632
MAME_DIR .. "3rdparty/softfloat3/bochs_ext/poly.c",
630633
MAME_DIR .. "3rdparty/softfloat3/bochs_ext/extF80_scale.c",
631634
}
635+
end
632636

633637

634638
-------------------------------------------------
635639
-- libJPEG library objects
636640
--------------------------------------------------
637641

638-
if not _OPTIONS["with-system-jpeg"] then
642+
if _OPTIONS["with-emulator"] and not _OPTIONS["with-system-jpeg"] then
639643
project "jpeg"
640644
uuid "447c6800-dcfd-4c48-b72a-a8223bb409ca"
641645
kind "StaticLib"
@@ -954,7 +958,7 @@ end
954958
--------------------------------------------------
955959
if (STANDALONE~=true) then
956960

957-
if not _OPTIONS["with-system-lua"] then
961+
if _OPTIONS["with-emulator"] and not _OPTIONS["with-system-lua"] then
958962
project "lua"
959963
uuid "d9e2eed1-f1ab-4737-a6ac-863700b1a5a9"
960964
kind "StaticLib"
@@ -1044,6 +1048,7 @@ end
10441048
-- small lua library objects
10451049
--------------------------------------------------
10461050

1051+
if _OPTIONS["with-emulator"] then
10471052
project "lualibs"
10481053
uuid "1d84edab-94cf-48fb-83ee-b75bc697660e"
10491054
kind "StaticLib"
@@ -1093,12 +1098,13 @@ project "lualibs"
10931098
MAME_DIR .. "3rdparty/luafilesystem/src/lfs.c",
10941099
MAME_DIR .. "3rdparty/lua-linenoise/linenoise.c",
10951100
}
1101+
end
10961102

10971103
--------------------------------------------------
10981104
-- SQLite3 library objects
10991105
--------------------------------------------------
11001106

1101-
if not _OPTIONS["with-system-sqlite3"] then
1107+
if _OPTIONS["with-emulator"] and not _OPTIONS["with-system-sqlite3"] then
11021108
project "sqlite3"
11031109
uuid "5cb3d495-57ed-461c-81e5-80dc0857517d"
11041110
kind "StaticLib"
@@ -1240,6 +1246,7 @@ end
12401246
-- BX library objects
12411247
--------------------------------------------------
12421248

1249+
if _OPTIONS["with-emulator"] then
12431250
project "bx"
12441251
uuid "238318fe-49f5-4eb4-88be-0618900f5eac"
12451252
kind "StaticLib"
@@ -1318,12 +1325,14 @@ project "bx"
13181325
MAME_DIR .. "3rdparty/bx/src/timer.cpp",
13191326
MAME_DIR .. "3rdparty/bx/src/url.cpp",
13201327
}
1328+
end
13211329

13221330

13231331
--------------------------------------------------
13241332
-- BIMG library objects
13251333
--------------------------------------------------
13261334

1335+
if _OPTIONS["with-emulator"] then
13271336
project "bimg"
13281337
uuid "5603611b-8bf8-4ffd-85bc-76858cd7df39"
13291338
kind "StaticLib"
@@ -1437,12 +1446,14 @@ project "bimg"
14371446

14381447
MAME_DIR .. "3rdparty/bimg/3rdparty/tinyexr/deps/miniz/miniz.c",
14391448
}
1449+
end
14401450

14411451

14421452
--------------------------------------------------
14431453
-- BGFX library objects
14441454
--------------------------------------------------
14451455

1456+
if _OPTIONS["with-emulator"] then
14461457
project "bgfx"
14471458
uuid "d3e7e119-35cf-4f4f-aba0-d3bdcd1b879a"
14481459
kind "StaticLib"
@@ -1633,6 +1644,7 @@ end
16331644
"-D BGFX_CONFIG_MULTITHREADED=0",
16341645
}
16351646
end
1647+
end
16361648

16371649

16381650
--------------------------------------------------
@@ -1813,6 +1825,7 @@ end
18131825
-- linenoise library
18141826
--------------------------------------------------
18151827

1828+
if _OPTIONS["with-emulator"] then
18161829
project "linenoise"
18171830
uuid "7320ffc8-2748-4add-8864-ae29b72a8511"
18181831
kind (LIBTYPE)
@@ -1839,6 +1852,7 @@ project "linenoise"
18391852
MAME_DIR .. "3rdparty/linenoise/stringbuf.c",
18401853
MAME_DIR .. "3rdparty/linenoise/utf8.c",
18411854
}
1855+
end
18421856

18431857

18441858
--------------------------------------------------
@@ -1875,6 +1889,7 @@ end
18751889
-- wdlfft library objects (from Cockos WDL)
18761890
--------------------------------------------------
18771891

1892+
if _OPTIONS["with-emulator"] then
18781893
project "wdlfft"
18791894
uuid "74ca017e-fa0d-48b8-81d6-8081a37be14c"
18801895
kind "StaticLib"
@@ -1890,12 +1905,14 @@ project "wdlfft"
18901905
MAME_DIR .. "3rdparty/wdlfft/fft.c",
18911906
MAME_DIR .. "3rdparty/wdlfft/fft.h"
18921907
}
1908+
end
18931909

18941910

18951911
--------------------------------------------------
18961912
-- ymfm library objects
18971913
--------------------------------------------------
18981914

1915+
if _OPTIONS["with-emulator"] then
18991916
project "ymfm"
19001917
uuid "2403a536-cb0a-4b50-b41f-10c17917689b"
19011918
kind "StaticLib"
@@ -1928,6 +1945,7 @@ project "ymfm"
19281945
MAME_DIR .. "3rdparty/ymfm/src/ymfm_ssg.cpp",
19291946
MAME_DIR .. "3rdparty/ymfm/src/ymfm_ssg.h",
19301947
}
1948+
end
19311949

19321950

19331951
--------------------------------------------------

0 commit comments

Comments
 (0)