mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
generate_microRTPS_bridge: add option to set preprocessor include paths of fastrtpsgen
This commit is contained in:
@@ -100,9 +100,13 @@ parser.add_argument("-u", "--client-outdir", dest='clientdir', type=str, nargs=1
|
|||||||
help="Client output dir, by default src/modules/micrortps_bridge/micrortps_client", default=default_client_out)
|
help="Client output dir, by default src/modules/micrortps_bridge/micrortps_client", default=default_client_out)
|
||||||
parser.add_argument("-f", "--fastrtpsgen-dir", dest='fastrtpsgen', type=str, nargs='?',
|
parser.add_argument("-f", "--fastrtpsgen-dir", dest='fastrtpsgen', type=str, nargs='?',
|
||||||
help="fastrtpsgen installation dir, only needed if fastrtpsgen is not in PATH, by default empty", default="")
|
help="fastrtpsgen installation dir, only needed if fastrtpsgen is not in PATH, by default empty", default="")
|
||||||
|
parser.add_argument("-g", "--fastrtpsgen-include", dest='fastrtpsgen_include', type=str, nargs='?',
|
||||||
|
help="directory(ies) to add to preprocessor include paths of fastrtpsgen, by default empty", default="")
|
||||||
parser.add_argument("--delete-tree", dest='del_tree',
|
parser.add_argument("--delete-tree", dest='del_tree',
|
||||||
action="store_true", help="Delete dir tree output dir(s)")
|
action="store_true", help="Delete dir tree output dir(s)")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
if len(sys.argv) <= 1:
|
||||||
parser.print_usage()
|
parser.print_usage()
|
||||||
exit(-1)
|
exit(-1)
|
||||||
@@ -139,6 +143,7 @@ else:
|
|||||||
# Path to fastrtpsgen is explicitly specified
|
# Path to fastrtpsgen is explicitly specified
|
||||||
fastrtpsgen_path = os.path.join(
|
fastrtpsgen_path = os.path.join(
|
||||||
get_absolute_path(args.fastrtpsgen), "/fastrtpsgen")
|
get_absolute_path(args.fastrtpsgen), "/fastrtpsgen")
|
||||||
|
fastrtpsgen_include = get_absolute_path(args.fastrtpsgen_include)
|
||||||
|
|
||||||
# If nothing specified it's generated both
|
# If nothing specified it's generated both
|
||||||
if agent == False and client == False:
|
if agent == False and client == False:
|
||||||
@@ -230,7 +235,7 @@ def generate_agent(out_dir):
|
|||||||
raise Exception("No IDL files found in %s" % idl_dir)
|
raise Exception("No IDL files found in %s" % idl_dir)
|
||||||
for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")):
|
for idl_file in glob.glob(os.path.join(idl_dir, "*.idl")):
|
||||||
ret = subprocess.call(fastrtpsgen_path + " -d " + out_dir +
|
ret = subprocess.call(fastrtpsgen_path + " -d " + out_dir +
|
||||||
"/fastrtpsgen -example x64Linux2.6gcc " + idl_file, shell=True)
|
"/fastrtpsgen -example x64Linux2.6gcc " + "-I " + fastrtpsgen_include + " " + idl_file, shell=True)
|
||||||
if ret:
|
if ret:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"fastrtpsgen not found. Specify the location of fastrtpsgen with the -f flag")
|
"fastrtpsgen not found. Specify the location of fastrtpsgen with the -f flag")
|
||||||
|
|||||||
Reference in New Issue
Block a user