File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ cmake_minimum_required(VERSION 2.8.12)
11
11
list (APPEND CMAKE_MODULE_PATH
12
12
"${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
13
13
14
+ set (SWIFT_BENCHMARK_BUILT_STANDALONE FALSE )
15
+ if ("${CMAKE_SOURCE_DIR} " STREQUAL "${CMAKE_CURRENT_SOURCE_DIR} " )
16
+ set (SWIFT_BENCHMARK_BUILT_STANDALONE TRUE )
17
+ endif ()
18
+
14
19
include (AddSwiftBenchmarkSuite )
15
20
16
21
set (SWIFT_BENCH_MODULES
@@ -240,16 +245,12 @@ endforeach()
240
245
241
246
set (executable_targets )
242
247
243
- if (SWIFT_SDKS )
244
- set (IS_SWIFT_BUILD true )
245
- endif ()
246
-
247
248
set (srcdir "${CMAKE_CURRENT_SOURCE_DIR} " )
248
249
249
- if (IS_SWIFT_BUILD )
250
- get_filename_component (swift-bin-dir "${SWIFT_EXEC} " DIRECTORY )
251
- else ()
250
+ if (SWIFT_BENCHMARK_BUILT_STANDALONE )
252
251
set (swift-bin-dir "${CMAKE_BINARY_DIR} /bin" )
252
+ else ()
253
+ get_filename_component (swift-bin-dir "${SWIFT_EXEC} " DIRECTORY )
253
254
endif ()
254
255
255
256
set (benchmark-bin-dir "${CMAKE_CURRENT_BINARY_DIR} /bin" )
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ endfunction()
415
415
function (swift_benchmark_compile )
416
416
cmake_parse_arguments (SWIFT_BENCHMARK_COMPILE "" "PLATFORM" "" ${ARGN} )
417
417
418
- if (IS_SWIFT_BUILD )
418
+ if (NOT SWIFT_BENCHMARK_BUILT_STANDALONE )
419
419
set (stdlib_dependencies "swift" )
420
420
foreach (stdlib_dependency ${UNIVERSAL_LIBRARY_NAMES_${SWIFT_BENCHMARK_COMPILE_PLATFORM}} )
421
421
string (FIND "${stdlib_dependency} " "Unittest" find_output )
@@ -441,7 +441,7 @@ function(swift_benchmark_compile)
441
441
add_custom_target ("${executable_target} "
442
442
DEPENDS ${platform_executables} )
443
443
444
- if (IS_SWIFT_BUILD AND "${SWIFT_BENCHMARK_COMPILE_PLATFORM} " STREQUAL "macosx" )
444
+ if (NOT SWIFT_BENCHMARK_BUILT_STANDALONE AND "${SWIFT_BENCHMARK_COMPILE_PLATFORM} " STREQUAL "macosx" )
445
445
add_custom_command (
446
446
TARGET "${executable_target} "
447
447
POST_BUILD
You can’t perform that action at this time.
0 commit comments