Skip to content

Commit ab34ae1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent aa7d132 commit ab34ae1

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

CMakeLists.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ endif()
9191
option(PYBIND11_INSTALL "Install pybind11 header files?" ${PYBIND11_MASTER_PROJECT})
9292
option(PYBIND11_TEST "Build pybind11 test suite?" ${PYBIND11_MASTER_PROJECT})
9393
option(PYBIND11_NOPYTHON "Disable search for Python" OFF)
94-
option(PYBIND11_COMPILE_LIBRARY "Create a library target for pybind11 that is not header-only (default)" ON)
94+
option(PYBIND11_COMPILE_LIBRARY
95+
"Create a library target for pybind11 that is not header-only (default)" ON)
9596
set(PYBIND11_INTERNALS_VERSION
9697
""
9798
CACHE STRING "Override the ABI version, may be used to enable the unstable ABI.")
@@ -142,7 +143,7 @@ if("${PYTHON_MODULE_EXTENSION}" MATCHES "pypy" OR "${Python_INTERPRETER_ID}" STR
142143
# Pypy does not support embedding.
143144
list(REMOVE_ITEM PYBIND11_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/embed.cc)
144145
endif()
145-
146+
146147
# If we're not configured to be -onheaderly, we need to build a shared library
147148
# and define the pybind11::lib target.
148149
if(PYBIND11_COMPILE_LIBRARY)
@@ -152,11 +153,11 @@ if(PYBIND11_COMPILE_LIBRARY)
152153
add_library(pybind11::static ALIAS pybind11_static)
153154
target_link_libraries(pybind11_static PRIVATE pybind11::pybind11)
154155
target_link_libraries(pybind11_static PUBLIC pybind11::headers)
155-
install(TARGETS pybind11_static
156+
install(
157+
TARGETS pybind11_static
156158
EXPORT pybind11::static
157159
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
158-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
159-
)
160+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
160161
endif()
161162

162163
# Compare with grep and warn if mismatched

include/pybind11/detail/common.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,11 @@
119119
// PYBIND11_INLINE should be used for function definitions in '-inl' files, so they
120120
// can be made non-inline when compiles as a static library.
121121
#if defined(PYBIND11_AS_STATIC_LIBRARY)
122-
# define PYBIND11_INLINE
122+
# define PYBIND11_INLINE
123123
#else
124124
# define PYBIND11_INLINE inline
125125
#endif
126126

127-
128127
#if defined(PYBIND11_NOINLINE_DISABLED) // Option for maximum portability and experimentation.
129128
# define PYBIND11_NOINLINE_ATTR
130129
#elif defined(_MSC_VER)
@@ -136,7 +135,8 @@
136135
// The PYBIND11_NOINLINE macro is for function DEFINITIONS.
137136
// In contrast, FORWARD DECLARATIONS should never use this macro:
138137
// https://stackoverflow.com/questions/9317473/forward-declaration-of-inline-functions
139-
// This macro shouldn't be used in '-inl' files. Instead, use `PYBIND11_NOINLINE_ATTR PYBIND11_INLINE`.
138+
// This macro shouldn't be used in '-inl' files. Instead, use `PYBIND11_NOINLINE_ATTR
139+
// PYBIND11_INLINE`.
140140
#define PYBIND11_NOINLINE PYBIND11_NOINLINE_ATTR inline
141141

142142
#if defined(__MINGW32__)
@@ -1174,5 +1174,5 @@ PYBIND11_NAMESPACE_END(detail)
11741174
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
11751175

11761176
#ifndef PYBIND11_AS_STATIC_LIBRARY
1177-
# include "common-inl.h"
1177+
# include "common-inl.h"
11781178
#endif

src/detail/common.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "pybind11/detail/common-inl.h"
1+
#include "pybind11/detail/common-inl.h"

tools/pybind11Config.cmake.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/pybind11Targets.cmake")
222222
add_library(pybind11::headers IMPORTED INTERFACE)
223223
set_target_properties(pybind11::headers PROPERTIES INTERFACE_LINK_LIBRARIES
224224
pybind11::pybind11_headers)
225-
if (@PYBIND11_COMPILE_LIBRARY@)
225+
if(@PYBIND11_COMPILE_LIBRARY@)
226226
add_library(pybind11::static IMPORTED INTERFACE)
227227
set_target_properties(pybind11::static PROPERTIES INTERFACE_LINK_LIBRARIES
228228
pybind11::pybind11_static)

0 commit comments

Comments
 (0)