Changeset d817128 in suil


Ignore:
Timestamp:
Oct 3, 2017, 1:41:23 PM (6 weeks ago)
Author:
David Robillard <d@…>
Branches:
master
Children:
3863301
Parents:
cdfe1f8
git-author:
David Robillard <d@…> (10/03/17 11:23:00)
git-committer:
David Robillard <d@…> (10/03/17 13:41:23)
Message:

Clean up wscript

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    rcdfe1f8 rd817128  
    22import os
    33import subprocess
    4 import sys
    5 import waflib.Options as Options
     4import waflib.TaskGen as TaskGen
    65import waflib.extras.autowaf as autowaf
    7 from waflib import TaskGen
    8 
    9 # Library and package version (UNIX style major, minor, micro)
    10 # major increment <=> incompatible changes
    11 # minor increment <=> compatible changes (additions)
    12 # micro increment <=> no interface changes
     6
     7# Semver package/library version
    138SUIL_VERSION       = '0.8.7'
    14 SUIL_MAJOR_VERSION = '0'
     9SUIL_MAJOR_VERSION = SUIL_VERSION[0:SUIL_VERSION.find('.')]
    1510
    1611# Mandatory waf variables
     
    2015out     = 'build'       # Build directory
    2116
    22 def options(opt):
    23     opt.load('compiler_c')
    24     opt.load('compiler_cxx')
    25     autowaf.set_options(opt)
     17def options(ctx):
     18    ctx.load('compiler_c')
     19    ctx.load('compiler_cxx')
     20    autowaf.set_options(ctx)
     21    opt = ctx.get_option_group('Configuration options')
    2622    opt.add_option('--static', action='store_true', dest='static',
    27                    help="Build static library")
     23                   help='build static library')
    2824    opt.add_option('--no-shared', action='store_true', dest='no_shared',
    29                    help='Do not build shared library')
     25                   help='do not build shared library')
    3026    opt.add_option('--no-gtk', action='store_true', dest='no_gtk',
    31                    help='Do not build support for Gtk')
     27                   help='do not build support for Gtk')
    3228    opt.add_option('--no-qt', action='store_true', dest='no_qt',
    33                    help='Do not build support for Qt (any version)')
     29                   help='do not build support for Qt (any version)')
    3430    opt.add_option('--no-qt4', action='store_true', dest='no_qt4',
    35                    help='Do not build support for Qt4')
     31                   help='do not build support for Qt4')
    3632    opt.add_option('--no-qt5', action='store_true', dest='no_qt5',
    37                    help='Do not build support for Qt5')
     33                   help='do not build support for Qt5')
    3834    opt.add_option('--gtk2-lib-name', type='string', dest='gtk2_lib_name',
    3935                   default="libgtk-x11-2.0.so.0",
     
    5248    autowaf.set_cxx11_mode(conf)
    5349
    54     conf.env.BUILD_SHARED = not Options.options.no_shared
    55     conf.env.BUILD_STATIC = Options.options.static
     50    conf.env.BUILD_SHARED = not conf.options.no_shared
     51    conf.env.BUILD_STATIC = conf.options.static
    5652
    5753    if not conf.env.BUILD_SHARED and not conf.env.BUILD_STATIC:
     
    6864    autowaf.check_pkg(conf, 'x11', uselib_store='X11', mandatory=False)
    6965
    70     if not Options.options.no_gtk:
     66    if not conf.options.no_gtk:
    7167        autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK2',
    7268                          atleast_version='2.18.0', mandatory=False)
     
    8985                          atleast_version='3.14.0', mandatory=False)
    9086
    91     if not Options.options.no_qt:
    92         if not Options.options.no_qt4:
     87    if not conf.options.no_qt:
     88        if not conf.options.no_qt4:
    9389            autowaf.check_pkg(conf, 'QtGui', uselib_store='QT4',
    9490                              atleast_version='4.4.0', mandatory=False)
    9591
    96         if not Options.options.no_qt5:
     92        if not conf.options.no_qt5:
    9793            autowaf.check_pkg(conf, 'Qt5Widgets', uselib_store='QT5',
    9894                              atleast_version='5.1.0', mandatory=False)
     
    106102                   conf.env.LIBDIR + '/suil-' + SUIL_MAJOR_VERSION)
    107103    autowaf.define(conf, 'SUIL_DIR_SEP', '/')
    108     autowaf.define(conf, 'SUIL_GTK2_LIB_NAME', Options.options.gtk2_lib_name);
    109     autowaf.define(conf, 'SUIL_GTK3_LIB_NAME', Options.options.gtk3_lib_name);
     104    autowaf.define(conf, 'SUIL_GTK2_LIB_NAME', conf.options.gtk2_lib_name);
     105    autowaf.define(conf, 'SUIL_GTK3_LIB_NAME', conf.options.gtk3_lib_name);
    110106
    111107    if conf.env.HAVE_GTK2 and conf.env.HAVE_QT4:
     
    368364    bld.add_post_fun(autowaf.run_ldconfig)
    369365    if bld.env.DOCS:
    370         bld.add_post_fun(fix_docs)
    371 
    372 def fix_docs(ctx):
    373     if ctx.cmd == 'build':
    374         autowaf.make_simple_dox(APPNAME)
     366        bld.add_post_fun(lambda ctx: autowaf.make_simple_dox(APPNAME))
    375367
    376368def upload_docs(ctx):
Note: See TracChangeset for help on using the changeset viewer.