Skip to content

Commit

Permalink
fix symbol hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Oct 27, 2023
1 parent ea1b93f commit db0de97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python_bindings/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def build_extension(self, ext: CMakeExtension) -> None:
f"-DPython3_EXECUTABLE={sys.executable}",
# not used on MSVC, but no harm
f"-DCMAKE_BUILD_TYPE={cfg}",
# prevent symbol collision that leads to multiple pass registration and such
"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
"-DCMAKE_C_VISIBILITY_PRESET=hidden",
"-DCMAKE_CXX_VISIBILITY_PRESET=hidden",
]
if platform.system() == "Windows":
cmake_args += [
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def build_extension(self, ext: CMakeExtension) -> None:
"-DMLIR_DETECT_PYTHON_ENV_PRIME_SEARCH=ON",
# not used on MSVC, but no harm
f"-DCMAKE_BUILD_TYPE={cfg}",
# prevent symbol collision that leads to multiple pass registration and such
"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
"-DCMAKE_C_VISIBILITY_PRESET=hidden",
"-DCMAKE_CXX_VISIBILITY_PRESET=hidden",
]
if platform.system() == "Windows":
cmake_args += [
Expand Down

0 comments on commit db0de97

Please sign in to comment.