Skip to content

Commit d9a65f4

Browse files
authored
Merge pull request #16833 from gottesmm/pr-36d7415d3531d61aabb8231290000c5797d2bf8e
2 parents 24abeca + 09e1e20 commit d9a65f4

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@
22
include(CMakeParseArguments)
33
include(SwiftBenchmarkUtils)
44

5-
# Run a shell command and assign output to a variable or fail with an error.
6-
# Example usage:
7-
# runcmd(COMMAND "xcode-select" "-p"
8-
# VARIABLE xcodepath
9-
# ERROR "Unable to find current Xcode path")
10-
function(runcmd)
11-
cmake_parse_arguments(RUNCMD "" "VARIABLE;ERROR" "COMMAND" ${ARGN})
12-
execute_process(
13-
COMMAND ${RUNCMD_COMMAND}
14-
OUTPUT_VARIABLE ${RUNCMD_VARIABLE}
15-
RESULT_VARIABLE result
16-
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
17-
if(NOT "${result}" MATCHES "0")
18-
message(FATAL_ERROR "${RUNCMD_ERROR}")
19-
endif()
20-
set(${RUNCMD_VARIABLE} ${${RUNCMD_VARIABLE}} PARENT_SCOPE)
21-
endfunction(runcmd)
22-
235
function (add_swift_benchmark_library objfile_out sibfile_out)
246
cmake_parse_arguments(BENCHLIB "" "MODULE_PATH;SOURCE_DIR;OBJECT_DIR" "SOURCES;LIBRARY_FLAGS;DEPENDS" ${ARGN})
257

benchmark/cmake/modules/SwiftBenchmarkUtils.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,22 @@ function(translate_flag is_set flag_name var_name)
4343
set("${var_name}" "" PARENT_SCOPE)
4444
endif()
4545
endfunction()
46+
47+
48+
# Run a shell command and assign output to a variable or fail with an error.
49+
# Example usage:
50+
# runcmd(COMMAND "xcode-select" "-p"
51+
# VARIABLE xcodepath
52+
# ERROR "Unable to find current Xcode path")
53+
function(runcmd)
54+
cmake_parse_arguments(RUNCMD "" "VARIABLE;ERROR" "COMMAND" ${ARGN})
55+
execute_process(
56+
COMMAND ${RUNCMD_COMMAND}
57+
OUTPUT_VARIABLE ${RUNCMD_VARIABLE}
58+
RESULT_VARIABLE result
59+
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
60+
if(NOT "${result}" MATCHES "0")
61+
message(FATAL_ERROR "${RUNCMD_ERROR}")
62+
endif()
63+
set(${RUNCMD_VARIABLE} ${${RUNCMD_VARIABLE}} PARENT_SCOPE)
64+
endfunction(runcmd)

0 commit comments

Comments
 (0)