Allow player-only builds.
authorCarl Hetherington <cth@carlh.net>
Wed, 19 Sep 2018 22:37:55 +0000 (23:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 19 Sep 2018 22:37:55 +0000 (23:37 +0100)
cscript
src/tools/wscript
wscript

diff --git a/cscript b/cscript
index 04c27781eb065b3386d63ec70426006605f6cd9d..beb0815ffd8d9da81adaab45f4c76dc5b2fa97c4 100644 (file)
--- a/cscript
+++ b/cscript
@@ -363,6 +363,9 @@ def configure_options(target, options):
     if not options['gui']:
         opt += ' --disable-gui'
 
+    if options['player-only']:
+        opt += ' --player-only'
+
     # Build Windows debug versions with static linking as I think gdb works better then
     if target.debug and target.platform == 'windows':
         opt += ' --static-dcpomatic'
index 016e50d5a5876b24bc76d948b35c1fb507a44dd5..4c6a74a471ee23cdedd87294f2afee2c2e1d4c57 100644 (file)
@@ -35,31 +35,38 @@ def build(bld):
     if bld.env.TARGET_WINDOWS:
         uselib += 'WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE WINSOCK2 OLE32 DSOUND WINMM KSUSER '
 
-    for t in ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create']:
-        obj = bld(features='cxx cxxprogram')
-        obj.uselib = uselib
-        obj.includes = ['..']
-        obj.use    = ['libdcpomatic2']
-        obj.source = '%s.cc' % t
-        obj.target = t.replace('dcpomatic', 'dcpomatic2')
-        if t == 'server_test':
-            obj.install_path = None
-
-    if not bld.env.DISABLE_GUI:
-        for t in ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player']:
+    if not bld.env.PLAYER_ONLY:
+        for t in ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create']:
             obj = bld(features='cxx cxxprogram')
             obj.uselib = uselib
-            if bld.env.BUILD_STATIC or bld.env.TARGET_LINUX:
-                obj.uselib += ' GTK'
-            obj.uselib += ' WXWIDGETS'
             obj.includes = ['..']
-            obj.use    = ['libdcpomatic2', 'libdcpomatic2-wx']
+            obj.use    = ['libdcpomatic2']
             obj.source = '%s.cc' % t
-            if bld.env.TARGET_WINDOWS:
-                obj.source += ' ../../platform/windows/%s.rc' % t
             obj.target = t.replace('dcpomatic', 'dcpomatic2')
+            if t == 'server_test':
+                obj.install_path = None
+
+    gui_tools = []
+    if not bld.env.DISABLE_GUI:
+        if bld.env.PLAYER_ONLY:
+            gui_tools = ['dcpomatic_player']
+        else:
+            gui_tools = ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player']
+
+    for t in gui_tools:
+        obj = bld(features='cxx cxxprogram')
+        obj.uselib = uselib
+        if bld.env.BUILD_STATIC or bld.env.TARGET_LINUX:
+            obj.uselib += ' GTK'
+        obj.uselib += ' WXWIDGETS'
+        obj.includes = ['..']
+        obj.use    = ['libdcpomatic2', 'libdcpomatic2-wx']
+        obj.source = '%s.cc' % t
+        if bld.env.TARGET_WINDOWS:
+            obj.source += ' ../../platform/windows/%s.rc' % t
+        obj.target = t.replace('dcpomatic', 'dcpomatic2')
 
-        i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)
+    i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)
 
 def pot(bld):
     i18n.pot(os.path.join('src', 'tools'), 'dcpomatic.cc dcpomatic_batch.cc dcpomatic_kdm.cc dcpomatic_server.cc dcpomatic_player.cc', 'dcpomatic')
diff --git a/wscript b/wscript
index d6637f3f8cbe3b32e13b4361c3dcdec5926c7bab..c4102733687ef0dd3250d970b63b2489fc8cc97f 100644 (file)
--- a/wscript
+++ b/wscript
@@ -48,6 +48,7 @@ def options(opt):
 
     opt.add_option('--enable-debug',      action='store_true', default=False, help='build with debugging information and without optimisation')
     opt.add_option('--disable-gui',       action='store_true', default=False, help='disable building of GUI tools')
+    opt.add_option('--player-only',       action='store_true', default=False, help='just build the player; no other tools')
     opt.add_option('--disable-tests',     action='store_true', default=False, help='disable building of tests')
     opt.add_option('--install-prefix',                         default=None,  help='prefix of where DCP-o-matic will be installed')
     opt.add_option('--target-windows',    action='store_true', default=False, help='set up to do a cross-compile to make a Windows package')
@@ -73,6 +74,7 @@ def configure(conf):
 
     # Save conf.options that we need elsewhere in conf.env
     conf.env.DISABLE_GUI = conf.options.disable_gui
+    conf.env.PLAYER_ONLY = conf.options.player_only
     conf.env.DISABLE_TESTS = conf.options.disable_tests
     conf.env.TARGET_WINDOWS = conf.options.target_windows
     conf.env.TARGET_OSX = sys.platform == 'darwin'