diff --git a/common/util/fb-util.cabal b/common/util/fb-util.cabal index aa225dbd..53318b3b 100644 --- a/common/util/fb-util.cabal +++ b/common/util/fb-util.cabal @@ -60,7 +60,9 @@ common fb-haskell ghc-options: -O2 common fb-cpp - cxx-options: -std=c++17 -fcoroutines + cxx-options: -std=c++17 + if !flag(clang) + cxx-options: -fcoroutines if arch(x86_64) cxx-options: -march=haswell if flag(opt) @@ -69,6 +71,9 @@ common fb-cpp flag opt default: False +flag clang + default: False + library import: fb-haskell, fb-cpp diff --git a/cpp-channel/thrift-cpp-channel.cabal b/cpp-channel/thrift-cpp-channel.cabal index 11624ba6..c2bbc598 100644 --- a/cpp-channel/thrift-cpp-channel.cabal +++ b/cpp-channel/thrift-cpp-channel.cabal @@ -66,7 +66,9 @@ common fb-haskell ghc-options: -O2 common fb-cpp - cxx-options: -std=c++17 -fcoroutines + cxx-options: -std=c++17 + if !flag(clang) + cxx-options: -fcoroutines if arch(x86_64) cxx-options: -march=haswell if flag(opt) @@ -75,6 +77,9 @@ common fb-cpp flag opt default: False +flag clang + default: False + library import: fb-haskell, fb-cpp exposed-modules: diff --git a/server/thrift-server.cabal b/server/thrift-server.cabal index f4ebff65..6292d574 100644 --- a/server/thrift-server.cabal +++ b/server/thrift-server.cabal @@ -61,7 +61,9 @@ common fb-haskell ghc-options: -O2 common fb-cpp - cxx-options: -std=c++17 -fcoroutines + cxx-options: -std=c++17 + if !flag(clang) + cxx-options: -fcoroutines -- very important to use -fcoroutines here, because there are -- #ifdefs in the fbthrift code (e.g. ThriftServer.h) that must -- be consistent with the fbthrift build. @@ -73,6 +75,9 @@ common fb-cpp flag opt default: False +flag clang + default: False + library import: fb-haskell, fb-cpp exposed-modules: diff --git a/tests/thrift-tests.cabal b/tests/thrift-tests.cabal index 674d619f..950b0356 100644 --- a/tests/thrift-tests.cabal +++ b/tests/thrift-tests.cabal @@ -61,9 +61,14 @@ common fb-haskell common fb-cpp cxx-options: -std=c++17 + if !flag(clang) + cxx-options: -fcoroutines if arch(x86_64) cxx-options: -march=haswell +flag clang + default: False + common test-common hs-source-dirs: ., gen-hs2/ build-depends: aeson,