build: (fixes #881) fix scratch targets for file names containing dots

This commit is contained in:
Gabriel Ferreira
2023-04-08 15:19:31 -03:00
parent 6e66cc3ae9
commit 85fcf95f36
2 changed files with 4 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ function(create_scratch source_files)
string(REPLACE "/" "_" scratch_dirname "${scratch_dirname}")
# Get source name
get_filename_component(scratch_name ${scratch_src} NAME_WE)
get_filename_component(scratch_name ${scratch_src} NAME_WLE)
set(target_prefix scratch_)
if(scratch_dirname)

View File

@@ -1210,7 +1210,8 @@ class NS3ConfigureTestCase(NS3BaseTestCase):
test_files = ["scratch/main.cc",
"scratch/empty.cc",
"scratch/subdir1/main.cc",
"scratch/subdir2/main.cc"]
"scratch/subdir2/main.cc",
"scratch/main.test.dots.in.name.cc"]
backup_files = ["scratch/.main.cc"] # hidden files should be ignored
# Create test scratch files
@@ -1267,7 +1268,7 @@ class NS3ConfigureTestCase(NS3BaseTestCase):
)[0]
os.remove(os.path.join(executable_absolute_path, executable_name))
if path not in ["scratch/main.cc", "scratch/empty.cc"]:
if not os.listdir(os.path.dirname(path)):
os.rmdir(os.path.dirname(source_absolute_path))
return_code, stdout, stderr = run_ns3("configure -G \"{generator}\"")