Skip to content

Commit 8267ac1

Browse files
authored
feat(build/options): add --optimize and related flags (#119)
Allow setting -march=native -mtune=native and -fomit-frame-pointer all in one go, but also control each individually with new flags for each.
1 parent 5c513ce commit 8267ac1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

build-emacs-for-macos

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ class Build
502502
end
503503

504504
env << '-march=native' if options[:native_march]
505+
env << '-mtune=native' if options[:native_mtune]
506+
env << '-fomit-frame-pointer' if options[:fomit_frame_pointer]
505507

506508
if options[:fd_setsize].respond_to?(:>=) && options[:fd_setsize] >= 1024
507509
env += [
@@ -1845,12 +1847,34 @@ if __FILE__ == $PROGRAM_NAME
18451847
'(default: enabled if supported)'
18461848
) { |v| cli_options[:native_comp] = v }
18471849

1850+
opts.on(
1851+
'--optimize',
1852+
'Shorthand for --native-march --native-mtune --fomit-frame-pointer' \
1853+
'(default: disabled)'
1854+
) do
1855+
cli_options[:native_march] = true
1856+
cli_options[:native_mtune] = true
1857+
cli_options[:fomit_frame_pointer] = true
1858+
end
1859+
18481860
opts.on(
18491861
'--[no-]native-march',
18501862
'Enable/disable -march=native CFLAG' \
18511863
'(default: disabled)'
18521864
) { |v| cli_options[:native_march] = v }
18531865

1866+
opts.on(
1867+
'--[no-]native-mtune',
1868+
'Enable/disable -mtune=native CFLAG' \
1869+
'(default: disabled)'
1870+
) { |v| cli_options[:native_mtune] = v }
1871+
1872+
opts.on(
1873+
'--[no-]fomit-frame-pointer',
1874+
'Enable/disable -fomit-frame-pointer CFLAG' \
1875+
'(default: disabled)'
1876+
) { |v| cli_options[:fomit_frame_pointer] = v }
1877+
18541878
opts.on(
18551879
'--[no-]native-full-aot',
18561880
'Enable/disable NATIVE_FULL_AOT / Ahead of Time compilation ' \

0 commit comments

Comments
 (0)