mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
tools: add build path support on host_info tool
Adds a build_path argument for when CMake builds are used. This solves a problem when building the nxdiag tool with CMake. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
This commit is contained in:
parent
191e250cc3
commit
ec9a849e15
1 changed files with 18 additions and 2 deletions
|
|
@ -475,7 +475,9 @@ def generate_header(args):
|
|||
arch_chip_key
|
||||
)[-1]
|
||||
if "esp" in arch_chip:
|
||||
vendor_specific_module_path = os.path.abspath("./tools/espressif")
|
||||
vendor_specific_module_path = os.path.abspath(
|
||||
args.nuttx_path + "/tools/espressif"
|
||||
)
|
||||
sys.path.append(os.path.abspath(vendor_specific_module_path))
|
||||
vendor_specific_module = importlib.import_module("chip_info")
|
||||
get_vendor_info = getattr(vendor_specific_module, "get_vendor_info")
|
||||
|
|
@ -525,6 +527,16 @@ if __name__ == "__main__":
|
|||
|
||||
parser = argparse.ArgumentParser(add_help=False)
|
||||
parser.add_argument("nuttx_path", help="NuttX source directory path.")
|
||||
parser.add_argument(
|
||||
"-b",
|
||||
"--build_path",
|
||||
help=(
|
||||
"Build path. Required if using CMake build system.\n"
|
||||
"If not provided, the current working directory will be used."
|
||||
),
|
||||
action="store",
|
||||
default=None,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-h",
|
||||
"--help",
|
||||
|
|
@ -584,6 +596,10 @@ if __name__ == "__main__":
|
|||
sys.exit(1)
|
||||
|
||||
args = parser.parse_args()
|
||||
os.chdir(args.nuttx_path)
|
||||
|
||||
if args.build_path is None:
|
||||
args.build_path = args.nuttx_path
|
||||
|
||||
os.chdir(args.build_path)
|
||||
header = generate_header(args)
|
||||
print(header)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue