Skip to content

Commit

Permalink
Comment out "hidden" in cmake files, setup_helpers.py, disable `PYBIN…
Browse files Browse the repository at this point in the history
…D11_WERROR`
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Jul 15, 2022
1 parent 0ec9e31 commit e0c3750
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pybind11/setup_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
if WIN:
cflags += ["/EHsc", "/bigobj"]
else:
cflags += ["-fvisibility=hidden"]
# cflags += ["-fvisibility=hidden"]
env_cflags = os.environ.get("CFLAGS", "")
env_cppflags = os.environ.get("CPPFLAGS", "")
c_cpp_flags = shlex.split(env_cflags) + shlex.split(env_cppflags)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ function(pybind11_enable_warnings target_name)
-Wnon-virtual-dtor)
endif()

if(PYBIND11_WERROR)
if(PYBIND11_WERROR AND NOT PYBIND11_WERROR) # SILLY TRICK TO TURN OFF
if(MSVC)
target_compile_options(${target_name} PRIVATE /WX)
elseif(PYBIND11_CUDA_TESTS)
Expand Down
12 changes: 6 additions & 6 deletions tools/pybind11NewTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ function(pybind11_add_module target_name)
# py::module_local). We force it on everything inside the `pybind11`
# namespace; also turning it on for a pybind module compilation here avoids
# potential warnings or issues from having mixed hidden/non-hidden types.
if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
endif()
# if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
# set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
# endif()

if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET)
set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET "hidden")
endif()
# if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET)
# set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET "hidden")
# endif()

# If we don't pass a WITH_SOABI or WITHOUT_SOABI, use our own default handling of extensions
if(NOT ARG_WITHOUT_SOABI AND NOT "WITH_SOABI" IN_LIST ARG_UNPARSED_ARGUMENTS)
Expand Down
12 changes: 6 additions & 6 deletions tools/pybind11Tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ function(pybind11_add_module target_name)
# py::module_local). We force it on everything inside the `pybind11`
# namespace; also turning it on for a pybind module compilation here avoids
# potential warnings or issues from having mixed hidden/non-hidden types.
if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
endif()
# if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
# set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
# endif()

if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET)
set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET "hidden")
endif()
# if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET)
# set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET "hidden")
# endif()

if(ARG_NO_EXTRAS)
return()
Expand Down

0 comments on commit e0c3750

Please sign in to comment.