diff --git a/TARGETS b/TARGETS index dcf2729e7..3fac4a737 100644 --- a/TARGETS +++ b/TARGETS @@ -14,7 +14,6 @@ rocksdb_compiler_flags = [ "-DROCKSDB_RANGESYNC_PRESENT", "-DROCKSDB_SCHED_GETCPU_PRESENT", "-DROCKSDB_SUPPORT_THREAD_LOCAL", - "-DHAVE_SSE42", "-DOS_LINUX", "-DROCKSDB_UBSAN_RUN", # Flags to enable libs we include @@ -48,6 +47,10 @@ rocksdb_preprocessor_flags = [ "-I" + REPO_PATH, ] +rocksdb_arch_preprocessor_flags = { + "x86_64": ["-DHAVE_SSE42"], +} + cpp_library( name = "rocksdb_lib", headers = AutoHeaders.RECURSIVE_GLOB, @@ -263,6 +266,7 @@ cpp_library( ], deps = [], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) @@ -283,6 +287,7 @@ cpp_library( ], deps = [":rocksdb_lib"], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) @@ -296,6 +301,7 @@ cpp_library( ], deps = [":rocksdb_lib"], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) @@ -306,6 +312,7 @@ cpp_library( srcs = ["env/env_basic_test.cc"], deps = [":rocksdb_test_lib"], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) @@ -501,6 +508,7 @@ for test_cfg in ROCKS_TESTS: srcs = [test_cc], deps = [":rocksdb_test_lib"], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) diff --git a/buckifier/targets_cfg.py b/buckifier/targets_cfg.py index edc0e8455..33023a589 100644 --- a/buckifier/targets_cfg.py +++ b/buckifier/targets_cfg.py @@ -6,7 +6,7 @@ rocksdb_target_header = """ import os TARGETS_PATH = os.path.dirname(__file__) -REPO_PATH = TARGETS_PATH[(TARGETS_PATH.find('fbcode/') + len('fbcode/')):] + "/" +REPO_PATH = "rocksdb/src/" BUCK_BINS = "buck-out/gen/" + REPO_PATH TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh" rocksdb_compiler_flags = [ @@ -18,9 +18,7 @@ rocksdb_compiler_flags = [ "-DROCKSDB_RANGESYNC_PRESENT", "-DROCKSDB_SCHED_GETCPU_PRESENT", "-DROCKSDB_SUPPORT_THREAD_LOCAL", - "-DHAVE_SSE42", "-DOS_LINUX", - "-DROCKSDB_UBSAN_RUN", # Flags to enable libs we include "-DSNAPPY", "-DZLIB", @@ -51,6 +49,10 @@ rocksdb_preprocessor_flags = [ "-I" + REPO_PATH + "include/", "-I" + REPO_PATH, ] + +rocksdb_arch_preprocessor_flags = { + "x86_64": ["-DHAVE_SSE42"], +} """ @@ -61,6 +63,7 @@ cpp_library( srcs = [%s], deps = [%s], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) @@ -72,6 +75,7 @@ cpp_binary( srcs = [%s], deps = [%s], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, ) @@ -94,6 +98,7 @@ for test_cfg in ROCKS_TESTS: srcs = [test_cc], deps = [":rocksdb_test_lib"], preprocessor_flags = rocksdb_preprocessor_flags, + arch_preprocessor_flags = rocksdb_arch_preprocessor_flags, compiler_flags = rocksdb_compiler_flags, external_deps = rocksdb_external_deps, )