mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
pybind11_add_module(): OPT_SIZE target
This commit is contained in:
@@ -138,8 +138,8 @@ endif()
|
||||
# WITHOUT_SOABI and WITH_SOABI will disable the custom extension handling used by pybind11.
|
||||
# WITH_SOABI is passed on to python_add_library.
|
||||
function(pybind11_add_module target_name)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 ARG "STATIC;SHARED;MODULE;THIN_LTO;NO_EXTRAS;WITHOUT_SOABI"
|
||||
"" "")
|
||||
cmake_parse_arguments(PARSE_ARGV 1 ARG
|
||||
"STATIC;SHARED;MODULE;THIN_LTO;OPT_SIZE;NO_EXTRAS;WITHOUT_SOABI" "" "")
|
||||
|
||||
if(ARG_ADD_LIBRARY_STATIC)
|
||||
set(type STATIC)
|
||||
@@ -204,6 +204,10 @@ function(pybind11_add_module target_name)
|
||||
if(MSVC)
|
||||
target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)
|
||||
endif()
|
||||
|
||||
if(ARG_OPT_SIZE)
|
||||
target_link_libraries(${target_name} PRIVATE pybind11::opt_size)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(pybind11_extension name)
|
||||
|
||||
Reference in New Issue
Block a user