File tree Expand file tree Collapse file tree 2 files changed +19
-18
lines changed Expand file tree Collapse file tree 2 files changed +19
-18
lines changed Original file line number Diff line number Diff line change 2
2
include (CMakeParseArguments )
3
3
include (SwiftBenchmarkUtils )
4
4
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
-
23
5
function (add_swift_benchmark_library objfile_out sibfile_out )
24
6
cmake_parse_arguments (BENCHLIB "" "MODULE_PATH;SOURCE_DIR;OBJECT_DIR" "SOURCES;LIBRARY_FLAGS;DEPENDS" ${ARGN} )
25
7
Original file line number Diff line number Diff line change @@ -43,3 +43,22 @@ function(translate_flag is_set flag_name var_name)
43
43
set ("${var_name} " "" PARENT_SCOPE )
44
44
endif ()
45
45
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 )
You can’t perform that action at this time.
0 commit comments