Skip to content
Merged
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
8 changes: 8 additions & 0 deletions SConstruct
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,6 +75,12 @@ vars.Add(EnumVariable(
vars.Add(BoolVariable(
'profile',
'build with profiling information', False))
vars.Add(
'arch',
'target CPU passed to -march in the \'fast\' build, e.g. \'native\' for local '
'builds or \'x86-64-v3\' for a portable AVX2 deployment. Empty means no -march. '
'Defaults to the OBJCRYST_ARCH environment variable if set.',
os.environ.get('OBJCRYST_ARCH', ''))
vars.Update(env)

# Use C++ compiler specified by the 'tool' option.
Expand DownExpand Up@@ -184,6 +190,8 @@ else:
else:
env.AppendUnique(CCFLAGS=['-fno-strict-aliasing'])
fast_opts = ['-ffast-math']
if env.get('arch'):
fast_opts.append('-march=' + env['arch'])

if env['PLATFORM'] == 'darwin':
# macOS bundle
Expand Down
23 changes: 23 additions & 0 deletions news/compile_arch.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
**Added:**

* Add SCons ``arch`` option to set architecture during compilation. By default, no arch is specified.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
Loading