diff --git a/.travis.yml b/.travis.yml index 59d7df38..d5e9b5c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,6 @@ before_install: script: - buck test //:CSSLayout - buck test //:CSSLayout_java - - buck run //:benchmark + - buck run //benchmark:benchmark - git checkout HEAD^ - - buck run //:benchmark + - buck run //benchmark:benchmark diff --git a/BUCK b/BUCK index f626dc5a..fa9ef5b1 100644 --- a/BUCK +++ b/BUCK @@ -49,18 +49,6 @@ cxx_library( visibility = ['PUBLIC'], ) -cxx_binary( - name = 'benchmark', - srcs = glob(['benchmarks/*.c']), - headers = subdir_glob([('', 'benchmarks/*.h')]), - header_namespace = '', - compiler_flags = COMPILER_FLAGS, - deps = [ - ':CSSLayout', - ], - visibility = ['PUBLIC'], -) - cxx_test( name = 'CSSLayout_tests', contacts = ['emilsj@fb.com'], diff --git a/CSSLAYOUT_DEFS b/CSSLAYOUT_DEFS index e33cf002..6c45022f 100644 --- a/CSSLAYOUT_DEFS +++ b/CSSLAYOUT_DEFS @@ -9,6 +9,9 @@ GTEST_TARGET = '//lib/gtest:gtest' GTEST_DL_URL = 'https://github.com/google/googletest/archive/release-1.7.0.zip' JNI_DEPS = ['//lib/fb:fbjni'] +def csslayout_dep(dep): + return '//' + dep + class allow_unsafe_import: def __enter__(self): pass diff --git a/benchmark/BUCK b/benchmark/BUCK new file mode 100644 index 00000000..918600b2 --- /dev/null +++ b/benchmark/BUCK @@ -0,0 +1,27 @@ +# Copyright (c) 2014-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +include_defs('//CSSLAYOUT_DEFS') + +cxx_binary( + name = 'benchmark', + srcs = glob(['*.c']), + headers = subdir_glob([('', '*.h')]), + header_namespace = '', + compiler_flags = [ + '-fno-omit-frame-pointer', + '-fexceptions', + '-Wall', + '-Werror', + '-O3', + '-std=c11', + ], + deps = [ + csslayout_dep(':CSSLayout'), + ], + visibility = ['PUBLIC'], +) diff --git a/benchmarks/CSSBenchmark.c b/benchmark/CSSBenchmark.c similarity index 100% rename from benchmarks/CSSBenchmark.c rename to benchmark/CSSBenchmark.c diff --git a/benchmarks/CSSBenchmark.h b/benchmark/CSSBenchmark.h similarity index 100% rename from benchmarks/CSSBenchmark.h rename to benchmark/CSSBenchmark.h