File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -158,19 +158,23 @@ function(make_torchcodec_libraries
158158 # stray initialization of py::objects. The rest of the object code must
159159 # match. See:
160160 # https://pybind11.readthedocs.io/en/stable/faq.html#someclass-declared-with-greater-visibility-than-the-type-of-its-field-someclass-member-wattributes
161- target_compile_options (
162- ${pybind_ops_library_name}
163- PUBLIC
164- "-fvisibility=hidden"
165- )
166- # If we don't make sure this flag is set, we run into segfauls at import
167- # time on Mac. See:
168- # https://github.com/pybind/pybind11/issues/3907#issuecomment-1170412764
169- target_link_options (
170- ${pybind_ops_library_name}
171- PUBLIC
172- "LINKER:-undefined,dynamic_lookup"
173- )
161+ if (NOT WIN32 ) # TODO unify WIN detection
162+ target_compile_options (
163+ ${pybind_ops_library_name}
164+ PUBLIC
165+ "-fvisibility=hidden"
166+ )
167+ endif ()
168+ if (APPLE ) # TODO unify APPLE detection
169+ # If we don't make sure this flag is set, we run into segfauls at import
170+ # time on Mac. See:
171+ # https://github.com/pybind/pybind11/issues/3907#issuecomment-1170412764
172+ target_link_options (
173+ ${pybind_ops_library_name}
174+ PUBLIC
175+ "LINKER:-undefined,dynamic_lookup"
176+ )
177+ endif ()
174178
175179 # Install all libraries.
176180 set (
You can’t perform that action at this time.
0 commit comments