Skip to content

Commit

Permalink
chore: reduce overall diff
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Aug 12, 2024
1 parent 1223a98 commit 9c89f7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tools/pybind11Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ endif()
# are in CONFIG mode, they should be "normal" targets instead.
# In CMake 3.11+ you can promote a target to global after you create it,
# which might be simpler than this check.
if(NOT _pybind11_is_config)
get_property(
is_config
TARGET pybind11::headers
PROPERTY IMPORTED)
if(NOT is_config)
set(optional_global GLOBAL)
endif()

Expand Down Expand Up @@ -79,7 +83,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Emscripten AND NOT _pybind11_no_exceptions)
if(CMAKE_VERSION VERSION_LESS 3.13)
message(WARNING "CMake 3.13+ is required to build for Emscripten. Some flags will be missing")
else()
if(_pybind11_is_config)
if(_is_config)
set_property(
TARGET pybind11::pybind11_headers
APPEND
Expand Down
2 changes: 1 addition & 1 deletion tools/pybind11Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/pybind11Targets.cmake")
add_library(pybind11::headers IMPORTED INTERFACE)
set_target_properties(pybind11::headers PROPERTIES INTERFACE_LINK_LIBRARIES
pybind11::pybind11_headers)
set(_pybind11_is_config ON)

include("${CMAKE_CURRENT_LIST_DIR}/pybind11Common.cmake")

if(NOT pybind11_FIND_QUIETLY)
Expand Down

0 comments on commit 9c89f7a

Please sign in to comment.