Fix benchmark builds on non-Apple platforms (#1677)

This commit is contained in:
Gil authored and GitHub committed 2018-08-13 12:57:23 -07:00
1 parent 5fa898ef0d
commit 7bdcd93dfb
2 files changed
+22 -10

No files matched your search

+11 -9
View File
@@ -12,12 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
cc_binary(
firebase_firestore_util_string_apple_benchmark
SOURCES
string_apple_benchmark.mm
DEPENDS
benchmark
benchmark_main
firebase_firestore_util_base_apple
)
if(APPLE)
cc_binary(
firebase_firestore_util_string_apple_benchmark
SOURCES
string_apple_benchmark.mm
DEPENDS
benchmark
benchmark_main
firebase_firestore_util_base_apple
)
endif()
+11 -1
View File
@@ -18,6 +18,7 @@ include(CMakeParseArguments)
# target
# SOURCES sources...
# DEPENDS libraries...
# [EXCLUDE_FROM_ALL]
# )
#
# Defines a new library target with the given target name, sources, and
@@ -93,13 +94,15 @@ endfunction()
# target
# SOURCES sources...
# DEPENDS libraries...
# [EXCLUDE_FROM_ALL]
# )
#
# Defines a new executable target with the given target name, sources, and
# dependencies.
function(cc_binary name)
set(flag EXCLUDE_FROM_ALL)
set(multi DEPENDS SOURCES)
cmake_parse_arguments(ccb "" "" "${multi}" ${ARGN})
cmake_parse_arguments(ccb "${flag}" "" "${multi}" ${ARGN})
maybe_remove_objc_sources(sources ${ccb_SOURCES})
add_executable(${name} ${sources})
@@ -108,6 +111,13 @@ function(cc_binary name)
target_include_directories(${name} PUBLIC ${FIREBASE_SOURCE_DIR})
target_link_libraries(${name} ${ccb_DEPENDS})
if(ccb_EXCLUDE_FROM_ALL)
set_property(
TARGET ${name}
PROPERTY EXCLUDE_FROM_ALL ON
)
endif()
endfunction()
# cc_test(