build: print a message if a build target does not exist in ns3

This commit is contained in:
Gabriel Ferreira
2022-02-09 09:25:09 -03:00
parent 07b4ad8efd
commit 23a802f4b6

8
ns3
View File

@@ -724,12 +724,18 @@ def reconfigure_cmake_to_force_refresh(cmake, current_cmake_cache_folder, output
update_scratches_list(current_cmake_cache_folder)
def get_target_to_build(program_path, ns3_version, build_profile):
if ".py" in program_path:
return None
build_profile_suffix = "" if build_profile in ["release"] else "-" + build_profile
program_name = "".join(*re.findall("(.*)ns%s-(.*)%s" % (ns3_version, build_profile_suffix), program_path))
try:
program_name = "".join(*re.findall("(.*)ns%s-(.*)%s" % (ns3_version, build_profile_suffix), program_path))
except TypeError:
print("Target to build does not exist: %s" % program_path)
exit(1)
if "scratch" in program_path:
# Get the path to the program and replace slashes with underlines