Skip to content

Commit

Permalink
Static linking on build script only for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Oct 24, 2024
1 parent d8583dc commit 1fe7348
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
'-pipe', '-Ofast', '-s', '-std=c++17', '-fopenmp', '-mmmx',
'-msse', '-msse2', '-msse3', '-msse4', '-msse4.1', '-msse4.2',
'-mavx', '-mavx2', '-mfma', '-mfpmath=sse',
'-march=native', '-funroll-loops', '-ffast-math',
'-static', '-static-libgcc', '-static-libstdc++'
'-march=native', '-funroll-loops', '-ffast-math'
]

if PLATFORM != 'Windows':
exe_build_args.append('-flto=auto')
else:
exe_build_args += ['-static', '-static-libgcc', '-static-libstdc++']

if PLATFORM == 'Darwin':
exe_build_args.append('-Xpreprocessor')
Expand All @@ -104,8 +105,6 @@
exe_build_args.remove('-mfma')
exe_build_args.remove('-mfpmath=sse')
exe_build_args.remove('-s')
exe_build_args.remove('-static-libgcc')
exe_build_args.remove('-static-libstdc++')

rt_bin = os.path.join('dist', 'zhivocore-1.0.a')
rt_build_args = exe_build_args + cpp_files + [
Expand Down

0 comments on commit 1fe7348

Please sign in to comment.