Skip to content

Commit 0b60c6a

Browse files
committed
add cxx abi flag to setup.py
ghstack-source-id: 613fea7 Pull Request resolved: #204
1 parent 34a5572 commit 0b60c6a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,25 @@ def get_cmake_version():
2727

2828

2929
class MultipyRuntimeDevelop(develop):
30-
user_options = develop.user_options + [("cmakeoff", None, None)]
30+
user_options = develop.user_options + [("cmakeoff", None, None), ("abicxx", None, None)]
3131

3232
def initialize_options(self):
3333
develop.initialize_options(self)
3434
self.cmakeoff = None
35+
self.abicxx = None
3536

3637
def finalize_options(self):
3738
develop.finalize_options(self)
3839
if self.cmakeoff is not None:
3940
self.distribution.get_command_obj("build_ext").cmake_off = True
41+
if self.abicxx is not None:
42+
self.distribution.get_command_obj("build_ext").abicxx = True
4043

4144

4245
class MultipyRuntimeBuild(build_ext):
4346
user_options = build_ext.user_options + MultipyRuntimeDevelop.user_options
4447
cmake_off = False
48+
abicxx = False
4549

4650
def run(self):
4751
if self.cmake_off:
@@ -62,11 +66,12 @@ def run(self):
6266
if not os.path.exists(build_dir_abs):
6367
os.makedirs(build_dir_abs)
6468
legacy_python_cmake_flag = "OFF" if sys.version_info.minor > 7 else "ON"
69+
cxx_abi_flag="ON" if self.abicxx else "OFF"
6570

6671
print(f"-- Running multipy runtime makefile in dir {build_dir_abs}")
6772
try:
6873
subprocess.run(
69-
[f"cmake -DLEGACY_PYTHON_PRE_3_8={legacy_python_cmake_flag} .."],
74+
[f"cmake -DLEGACY_PYTHON_PRE_3_8={legacy_python_cmake_flag} -DABI_EQUALS_1={cxx_abi_flag} .."],
7075
cwd=build_dir_abs,
7176
shell=True,
7277
check=True,
@@ -185,3 +190,4 @@ def get_nightly_version():
185190
"Topic :: Scientific/Engineering :: Artificial Intelligence",
186191
],
187192
)
193+

0 commit comments

Comments
 (0)