Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions SConstruct
Original file line numberDiff line numberDiff line change
Expand Up@@ -123,6 +123,13 @@ vars.Add(EnumVariable(
'build',
'compiler settings',
'fast', allowed_values=('debug', 'fast')))
vars.Add(EnumVariable(
'warnings',
'warning flags policy',
'none', allowed_values=('all', 'none', 'default')))
vars.Add(BoolVariable(
'verbose',
'print build commands', False))
vars.Add(EnumVariable(
'tool',
'C++ compiler toolkit to be used',
Expand All@@ -135,6 +142,8 @@ vars.Add(BoolVariable(
'compile and link with the shared cctbx library', False))

vars.Update(env)
SetOption('silent', not env['verbose'])
SetOption('no_progress', not env['verbose'])
env.Help(MY_SCONS_HELP % vars.GenerateHelpText(env))

# the CPPPATH directories are checked by scons dependency scanner
Expand Down
26 changes: 13 additions & 13 deletions src/SConscript
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,19 +30,30 @@ if env['PLATFORM'] == 'darwin':
if platform.system().lower() == "windows":
# Visual c++
env.PrependUnique(CCFLAGS=['/Ox', '/EHsc', '/MD', '/DREAL=double'])
if env['warnings'] == 'none':
env.PrependUnique(CCFLAGS=['/w'])
env.AppendUnique(CPPDEFINES={'NDEBUG': None})
# env.AppendUnique(LINKFLAGS='/EXPORT')
else:
# Use double precision for objcryst's REAL
env.PrependUnique(CCFLAGS=['-DREAL=double'])
if env['warnings'] == 'none':
env.PrependUnique(LINKFLAGS=['-w'])
if icpc:
# options for Intel C++ compiler on hpc dev-intel07
env.PrependUnique(CCFLAGS=['-w1', '-fp-model', 'precise'])
if env['warnings'] == 'none':
env.PrependUnique(CCFLAGS=['-w'])
else:
env.PrependUnique(CCFLAGS=['-w1'])
env.PrependUnique(CCFLAGS=['-fp-model', 'precise'])
env.PrependUnique(LIBS=['imf'])
fast_optimflags = ['-fast', '-no-ipo']
else:
# g++ options
env.PrependUnique(CCFLAGS=['-Wall'])
if env['warnings'] == 'all':
env.PrependUnique(CCFLAGS=['-Wall'])
elif env['warnings'] == 'none':
env.PrependUnique(CCFLAGS=['-w'])
fast_optimflags = ['-ffast-math']

# Configure build variants
Expand DownExpand Up@@ -120,17 +131,6 @@ inc_target_path = lambda f: os.path.join(env['includedir'],
include_targets = [inc_target_path(f) for f in env['lib_includes']]
install_include = InstallAs(include_targets, env['lib_includes'])

# DEBUG installation
print("\nenv['lib_includes']:")
for f in env['lib_includes']:
print(f" {f.path}")
print("\ninclude_targets:")
for f in include_targets:
print(f" {f}")
print("\ninstall-include:")
for f in install_include:
print(f" {f.path}")

Alias('install-include', install_include)

# install
Expand Down
Loading