From 62a74a5ef916f263d2a5bf882de5e9cbfd0f7fd7 Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Fri, 17 Mar 2017 10:49:59 -0700 Subject: [PATCH] Move -fPIC into YOGA_DEFS Summary: Move -fPIC from BUCK to YOGA_DEFS, so that it can be overridden when building yoga inside another build tree (since the larger build tree may need its own configuration for -fPIC). No change when building yoga standalone. Reviewed By: emilsjolander Differential Revision: D4714782 fbshipit-source-id: c706336cda72b36045e744e4fcaea4c0899bcf38 --- BUCK | 3 +-- YOGA_DEFS | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BUCK b/BUCK index c31d7940..61f90d87 100644 --- a/BUCK +++ b/BUCK @@ -12,9 +12,8 @@ GMOCK_OVERRIDE_FLAGS = [ "-Wno-inconsistent-missing-override", ] -COMPILER_FLAGS = BASE_COMPILER_FLAGS + [ +COMPILER_FLAGS = LIBRARY_COMPILER_FLAGS + [ "-std=c11", - "-fPIC", ] TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + ["-std=c++11"] diff --git a/YOGA_DEFS b/YOGA_DEFS index 12380caa..c4242f5b 100644 --- a/YOGA_DEFS +++ b/YOGA_DEFS @@ -33,6 +33,10 @@ BASE_COMPILER_FLAGS = [ '-O3', ] +LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [ + '-fPIC', +] + def yoga_dep(dep): return '//' + dep