Skip to content

Commit f05653e

Browse files
Add missing macro.
1 parent f1e4d11 commit f05653e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/non_limited_api/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ endif()
1111

1212
option(PYBIND11_NONLIMITEDAPI_BUILD_STUBS "" ON)
1313

14+
set(PYBIND11_NONLIMITEDAPI_PYTHON_MIN_VERSION_HEX "" CACHE STRING "A hex Python version to bake into the library, e.g. `0x030800f0` for 3.8 (the `f0` suffix is always there and means a release version).")
15+
set(PYBIND11_NONLIMITEDAPI_SUFFIX "" CACHE STRING "A custom suffix to append to the built library name. Should normally be `[_AppName][_X.Y]`, where X,Y is the Python version.")
16+
set(PYBIND11_NONLIMITEDAPI_LIBRARY_OUTPUT_DIR "" CACHE PATH "Replaces the library installation path for the shim.")
17+
1418
if (${PYBIND11_NONLIMITEDAPI_BUILD_STUBS})
1519
project(pybind11nonlimitedapi_stubs)
1620
add_library(pybind11nonlimitedapi_stubs SHARED non_limited_api_stubs.cpp)
1721
target_include_directories(pybind11nonlimitedapi_stubs PUBLIC ../../include)
1822
target_include_directories(pybind11nonlimitedapi_stubs PUBLIC ${Python_INCLUDE_DIRS})
23+
target_compile_definitions(pybind11nonlimitedapi_stubs PUBLIC PYBIND11_NONLIMITEDAPI_LIB_SUFFIX_FOR_MODULE=\"${PYBIND11_NONLIMITEDAPI_SUFFIX}\")
1924

2025
install(TARGETS pybind11nonlimitedapi_stubs
2126
ARCHIVE DESTINATION lib
@@ -28,9 +33,6 @@ if (${PYBIND11_NONLIMITEDAPI_BUILD_STUBS})
2833
endif()
2934
endif()
3035

31-
set(PYBIND11_NONLIMITEDAPI_PYTHON_MIN_VERSION_HEX "" CACHE STRING "A hex Python version to bake into the library, e.g. `0x030800f0` for 3.8 (the `f0` suffix is always there and means a release version).")
32-
set(PYBIND11_NONLIMITEDAPI_SUFFIX "" CACHE STRING "A custom suffix to append to the built library name. Should normally be `[_AppName][_X.Y]`, where X,Y is the Python version.")
33-
set(PYBIND11_NONLIMITEDAPI_LIBRARY_OUTPUT_DIR "" CACHE PATH "Replaces the library installation path for the shim.")
3436
if (PYBIND11_NONLIMITEDAPI_PYTHON_MIN_VERSION_HEX STREQUAL "")
3537
message("Not building pybind11nonlimitedapi because no Python version is specified.")
3638
else()

0 commit comments

Comments
 (0)