Skip to content

Commit

Permalink
Added sConf library source files on build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Nov 23, 2024
1 parent 13902a7 commit 82f1e6f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
cpp_files = []
cc_files = []

lib_headers = ['-Ilib/sConf/include']
lib_source_files = []

def get_ext_instructions():
print('Checking extended instruction availability...')
features_to_check = [
Expand Down Expand Up @@ -71,6 +74,11 @@ def get_ext_instructions():
if file.endswith('.cc'):
cc_files.append(os.path.join(root, file))

for root, dirs, files in os.walk('lib/sConf/src'):
for file in files:
if file.endswith('.cpp'):
lib_source_files.append(os.path.join(root, file))

try:
ext_instructions = get_ext_instructions()

Expand All @@ -94,7 +102,7 @@ def get_ext_instructions():
'-std=c++17', '-fopenmp'] + ext_instructions + ['-mfpmath=sse',
'-march=native', '-funroll-loops', '-ffast-math', '-static', '-static-libgcc',
'-static-libstdc++'
] + cpp_files
] + lib_headers + lib_source_files + cpp_files

core_build_args = exe_build_args + [
'-shared',
Expand Down Expand Up @@ -138,7 +146,7 @@ def get_ext_instructions():
'-Wvolatile-register-var', '-Wwrite-strings', '-pipe', '-ffast-math', '-s',
'-std=c++20', '-fopenmp'] + ext_instructions + ['-march=native',
'-funroll-loops', '-ffast-math', '-D__TERMUX__'
] + cpp_files
] + lib_headers + lib_source_files + cpp_files

core_build_args = exe_build_args + [
'-fPIC', '-shared',
Expand Down Expand Up @@ -183,7 +191,7 @@ def get_ext_instructions():
'-Wvolatile-register-var', '-Wwrite-strings', '-pipe', '-ffast-math', '-s',
'-std=c++20', '-fopenmp'] + ext_instructions + ['-mfpmath=sse',
'-march=native', '-funroll-loops', '-ffast-math'
] + cpp_files
] + lib_headers + lib_source_files + cpp_files

core_build_args = exe_build_args + [
'-fPIC', '-shared',
Expand Down Expand Up @@ -230,7 +238,7 @@ def get_ext_instructions():
'-std=c++17', '-fopenmp', '-march=native', '-funroll-loops',
'-ffast-math', '-flto=auto', '-Xpreprocessor', '-O3',
'-Wno-header-guard', '-Wno-pessimizing-move'
] + cpp_files
] + lib_headers + lib_source_files + cpp_files

core_build_args = exe_build_args + ['-shared', '-o', OUTPUT_CORE]
exe_build_args += ['-o', OUTPUT_EXECUTABLE]
Expand Down

0 comments on commit 82f1e6f

Please sign in to comment.