Skip to content

Commit b2639b1

Browse files
wjakobhenryiii
authored andcommitted
avoid dummy _EXPORTS definition
1 parent 6ac3efa commit b2639b1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tools/pybind11NewTools.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ function(pybind11_add_module target_name)
208208
if(ARG_OPT_SIZE)
209209
target_link_libraries(${target_name} PRIVATE pybind11::opt_size)
210210
endif()
211+
212+
# Avoid the -D${target_name}_EXPORTS definition that CMake adds by default
213+
set_property(TARGET ${target_name} PROPERTY DEFINE_SYMBOL "")
211214
endfunction()
212215

213216
function(pybind11_extension name)

tools/pybind11Tools.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,7 @@ function(pybind11_add_module target_name)
188188
if(ARG_OPT_SIZE)
189189
target_link_libraries(${target_name} PRIVATE pybind11::opt_size)
190190
endif()
191+
192+
# Avoid the -D${target_name}_EXPORTS definition that CMake adds by default
193+
set_property(TARGET ${target_name} PROPERTY DEFINE_SYMBOL "")
191194
endfunction()

0 commit comments

Comments
 (0)