Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added nanobind.__main__; minor cmake interface simplifications
- Loading branch information
Showing
4 changed files
with
60 additions
and
10 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 @@ | ||
import argparse | ||
import sys | ||
import sysconfig | ||
|
||
from . import __version__, include_dir, cmake_dir | ||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--version", | ||
action="version", | ||
version=__version__, | ||
help="Print the version number.", | ||
) | ||
parser.add_argument( | ||
"--include_dir", | ||
action="store_true", | ||
help="Print the path to the nanobind C++ header directory." | ||
) | ||
parser.add_argument( | ||
"--cmake_dir", | ||
action="store_true", | ||
help="Print the path to the nanobind CMake module directory." | ||
) | ||
args = parser.parse_args() | ||
if not sys.argv[1:]: | ||
parser.print_help() | ||
if args.include_dir: | ||
print(include_dir()) | ||
if args.cmake_dir: | ||
print(cmake_dir()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |