Skip to content

Commit a36c649

Browse files
committed
[benchmark] We need the module_name in swift_benchmark_compile_archopts to look up sources.
This solves problems relating to the SOURCES variable not finding anything files. module_name expanded to nothing so: ${${module_name}_sources} -> ${_sources} -> '' Now we handle this properly. rdar://34556274
1 parent 0c74e48 commit a36c649

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,11 @@ function (swift_benchmark_compile_archopts)
327327
endforeach()
328328

329329
foreach(module_name_path ${SWIFT_MULTISOURCE_SWIFT3_BENCHES})
330-
set(objfile_out)
330+
get_filename_component(module_name "${module_name_path}" NAME)
331+
331332
if ("${bench_flags}" MATCHES "-whole-module.*" AND
332333
NOT "${bench_flags}" MATCHES "-num-threads.*")
334+
set(objfile_out)
333335
add_swift_multisource_wmo_benchmark_library(objfile_out
334336
MODULE_PATH "${module_name_path}"
335337
SOURCE_DIR "${srcdir}"
@@ -338,8 +340,9 @@ function (swift_benchmark_compile_archopts)
338340
LIBRARY_FLAGS ${common_swift3_options} ${bench_flags}
339341
DEPENDS ${bench_library_objects} ${stdlib_dependencies})
340342
precondition(objfile_out)
341-
list(APPEND SWIFT_BENCH_OBJFILES "${objfile}")
343+
list(APPEND SWIFT_BENCH_OBJFILES "${objfile_out}")
342344
else()
345+
set(objfiles_out)
343346
add_swift_multisource_nonwmo_benchmark_library(objfiles_out
344347
MODULE_PATH "${module_name_path}"
345348
SOURCE_DIR "${srcdir}"
@@ -353,9 +356,11 @@ function (swift_benchmark_compile_archopts)
353356
endforeach()
354357

355358
foreach(module_name_path ${SWIFT_MULTISOURCE_SWIFT4_BENCHES})
356-
set(objfile_out)
359+
get_filename_component(module_name "${module_name_path}" NAME)
360+
357361
if ("${bench_flags}" MATCHES "-whole-module.*" AND
358362
NOT "${bench_flags}" MATCHES "-num-threads.*")
363+
set(objfile_out)
359364
add_swift_multisource_wmo_benchmark_library(objfile_out
360365
MODULE_PATH "${module_name_path}"
361366
SOURCE_DIR "${srcdir}"
@@ -364,8 +369,9 @@ function (swift_benchmark_compile_archopts)
364369
LIBRARY_FLAGS ${common_swift4_options} ${bench_flags}
365370
DEPENDS ${bench_library_objects} ${stdlib_dependencies})
366371
precondition(objfile_out)
367-
list(APPEND SWIFT_BENCH_OBJFILES "${objfile}")
372+
list(APPEND SWIFT_BENCH_OBJFILES "${objfile_out}")
368373
else()
374+
set(objfiles_out)
369375
add_swift_multisource_nonwmo_benchmark_library(objfiles_out
370376
MODULE_PATH "${module_name_path}"
371377
SOURCE_DIR "${srcdir}"

0 commit comments

Comments
 (0)