diff --git a/CHANGES.html b/CHANGES.html index 5d2bf1741..fe6860570 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -75,6 +75,7 @@ us a note on ns-developers mailing list.

Changes to build system:

Changed behavior:

This section is for behavioral changes to the models that were not due to a bug fix. diff --git a/doc/tutorial/source/getting-started.rst b/doc/tutorial/source/getting-started.rst index d1221113c..555c4829a 100644 --- a/doc/tutorial/source/getting-started.rst +++ b/doc/tutorial/source/getting-started.rst @@ -504,6 +504,13 @@ the |ns3| programs by simply typing Okay, sorry, I made you build the |ns3| part of the system twice, but now you know how to change the configuration and build optimized code. +A command exists for checking which profile is currently active +for an already configured project: + + $ ./waf --check-profile + Waf: Entering directory `/path/to/ns-3-allinone/ns-3.24/build' + Build profile: debug + The build.py script discussed above supports also the ``--enable-examples`` and ``enable-tests`` arguments, but in general, does not directly support other waf options; for example, this will not work: diff --git a/waf-tools/cflags.py b/waf-tools/cflags.py index 5504dba92..6d807b5ef 100644 --- a/waf-tools/cflags.py +++ b/waf-tools/cflags.py @@ -152,11 +152,13 @@ def options(opt): help=("Specify the build profile. " "Build profiles control the default compilation flags" " used for C/C++ programs, if CCFLAGS/CXXFLAGS are not" - " set set in the environment. [Allowed Values: %s]" + " set in the environment. [Allowed Values: %s]" % ", ".join([repr(p) for p in list(profiles.keys())])), choices=list(profiles.keys()), dest='build_profile') - + opt.add_option('--check-profile', + help=('print out current build profile'), + default=False, dest='check_profile', action="store_true") def configure(conf): cc = conf.env['COMPILER_CC'] or None cxx = conf.env['COMPILER_CXX'] or None diff --git a/wscript b/wscript index e528882cf..dcc6cfa49 100644 --- a/wscript +++ b/wscript @@ -746,6 +746,11 @@ def _find_ns3_module(self, name): def build(bld): env = bld.env + if Options.options.check_profile: + print("Build profile: %s" % Options.options.build_profile) + raise SystemExit(0) + return + # If --enabled-modules option was given, then print a warning # message and exit this function. if Options.options.enable_modules: