mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
feat: add --extension-suffix
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
parent
20f37d8ff8
commit
8ccca8d333
@ -142,7 +142,7 @@ On Linux, the above example can be compiled using the following command:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3 -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')
|
$ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3 -m pybind11 --extension-suffix)
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ def main() -> None:
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.",
|
help="Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--extension-suffix",
|
||||||
|
action="store_true",
|
||||||
|
help="Print the extension for a Python module",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if not sys.argv[1:]:
|
if not sys.argv[1:]:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
@ -80,6 +85,8 @@ def main() -> None:
|
|||||||
print(quote(get_cmake_dir()))
|
print(quote(get_cmake_dir()))
|
||||||
if args.pkgconfigdir:
|
if args.pkgconfigdir:
|
||||||
print(quote(get_pkgconfig_dir()))
|
print(quote(get_pkgconfig_dir()))
|
||||||
|
if args.extension_suffix:
|
||||||
|
print(sysconfig.get_config_var("EXT_SUFFIX"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user