-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: pybind11 raise min to 2.7 and make self-builder (#4297)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
- Loading branch information
Showing
5 changed files
with
50 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
###################################################################### | ||
# pybind11 by hand! | ||
###################################################################### | ||
|
||
set_cache (pybind11_BUILD_VERSION 2.12.0 "pybind11 version for local builds") | ||
set (pybind11_GIT_REPOSITORY "https://github.com/pybind/pybind11") | ||
set (pybind11_GIT_TAG "v${pybind11_BUILD_VERSION}") | ||
set_cache (pybind11_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} | ||
DOC "Should a local pybind11 build, if necessary, build shared libraries" ADVANCED) | ||
|
||
string (MAKE_C_IDENTIFIER ${pybind11_BUILD_VERSION} pybind11_VERSION_IDENT) | ||
|
||
build_dependency_with_cmake(pybind11 | ||
VERSION ${pybind11_BUILD_VERSION} | ||
GIT_REPOSITORY ${pybind11_GIT_REPOSITORY} | ||
GIT_TAG ${pybind11_GIT_TAG} | ||
CMAKE_ARGS | ||
-D PYBIND11_PYTHON_VERSION=${PYTHON3_VERSION} | ||
# Don't built unnecessary parts of Pybind11 | ||
-D BUILD_TESTING=OFF | ||
-D PYBIND11_TEST=OFF | ||
) | ||
|
||
|
||
# Signal to caller that we need to find again at the installed location | ||
set (pybind11_REFIND TRUE) | ||
set (pybind11_REFIND_ARGS CONFIG) | ||
set (pybind11_REFIND_VERSION ${pybind11_BUILD_VERSION}) | ||
|
||
if (pybind11_BUILD_SHARED_LIBS) | ||
install_local_dependency_libs (pybind11 pybind11) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters