-
Notifications
You must be signed in to change notification settings - Fork 120
/
Copy pathbuild_binaries.py
37 lines (28 loc) · 1.04 KB
/
build_binaries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from fmpy import sharedLibraryExtension, platform
from fmpy import platform_tuple as current_platform_tuple
import os
import shutil
from subprocess import check_call
configuration = 'Release'
if os.name == 'nt':
generators = [
('win32', ['-G', 'Visual Studio 17 2022', '-A', 'Win32'], 'i686-windows'),
('win64', ['-G', 'Visual Studio 17 2022', '-A', 'x64'], 'x86_64-windows')
]
sl_prefix = ''
sl_suffix = sharedLibraryExtension
else:
generators = [(platform, ['-G', 'Unix Makefiles'], current_platform_tuple)]
sl_prefix = 'lib'
sl_suffix = sharedLibraryExtension
for platform, cmake_options, platform_tuple in generators:
build_dir = f'src/{platform}'
shutil.rmtree(build_dir, ignore_errors=True)
check_call([
'cmake',
'-D', f'CVODE_INSTALL_DIR=../sundials-5.3.0/{platform}/static/install',
'-D', 'CMAKE_OSX_ARCHITECTURES=arm64;x86_64',
'-S', 'src',
'-B', build_dir
] + cmake_options)
check_call(['cmake', '--build', build_dir, '--config', configuration])