diff options
author | David Robillard <d@drobilla.net> | 2020-08-14 10:24:38 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-14 10:24:38 +0200 |
commit | a6281bf9a5ad1a83df64ee29e023135cc4873ed9 (patch) | |
tree | f75653042ae47609a1e3fc28a48999c8739077c6 /extras/autowaf.py | |
parent | 3686fe1a60c875eacadf37f37c73c6525acbf221 (diff) | |
download | autowaf-a6281bf9a5ad1a83df64ee29e023135cc4873ed9.tar.gz autowaf-a6281bf9a5ad1a83df64ee29e023135cc4873ed9.tar.bz2 autowaf-a6281bf9a5ad1a83df64ee29e023135cc4873ed9.zip |
Only set CFLAGS and CXXFLAGS if they are unset in the environment
This provides reasonable conservative optimization defaults, but allows users
or packagers total control over the flags if necessary.
Diffstat (limited to 'extras/autowaf.py')
-rw-r--r-- | extras/autowaf.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/extras/autowaf.py b/extras/autowaf.py index 3d4c09a..af9cf29 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -539,10 +539,17 @@ def configure(conf): conf.env['CFLAGS'] = ['-O0', '-g'] conf.env['CXXFLAGS'] = ['-O0', '-g'] else: - if conf.env['MSVC_COMPILER']: - append_cxx_flags(['/MD', '/FS', '/DNDEBUG']) - else: - append_cxx_flags(['-DNDEBUG']) + if 'CFLAGS' not in os.environ: + if conf.env['MSVC_COMPILER']: + conf.env.append_unique('CFLAGS', ['/O2', '/DNDEBUG']) + else: + conf.env.append_unique('CFLAGS', ['-O2', '-DNDEBUG']) + + if 'CXXFLAGS' not in os.environ: + if conf.env['MSVC_COMPILER']: + conf.env.append_unique('CXXFLAGS', ['/O2', '/DNDEBUG']) + else: + conf.env.append_unique('CXXFLAGS', ['-O2', '-DNDEBUG']) if Options.options.ultra_strict: Options.options.strict = True |