-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathLibMozc.hs
More file actions
35 lines (30 loc) · 1.19 KB
/
LibMozc.hs
File metadata and controls
35 lines (30 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
module Rules.LibMozc where
import Base
import CMakeBuilder
data LibMozc = LibMozc
deriving stock (Eq, Show, Typeable, Generic)
deriving anyclass (Hashable, Binary, NFData)
type instance RuleResult LibMozc = ()
libmozcRule :: Rules ()
libmozcRule = do
buildLibmozc <-
useCMake $
(cmakeBuilder "libmozc")
{ preBuild = BuildAction $ \_ src -> do
cmd_ (Cwd src) "cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOZC_ADDON=OFF"
cmd_ (Cwd src) "cmake --build build --target protoc",
cmakeFlags =
const
[ "-DPROTOC_EXECUTABLE=../../build/protoc",
"-DCMAKE_CXX_FLAGS=-I../../libmozc/mozc/src/bazel-bin",
"-DBUILD_MOZC_ADDON=OFF"
],
postBuildEachABI = BuildActionABI $ \_ BuildEnv {..} -> do
cmd_ (Cwd buildEnvBuildDir) Shell "ar rc" (buildEnvOutPrefix </> "lib" </> "libabsl.a") "$(find mozc/src/third_party/abseil-cpp -name '*.o')"
}
"libmozc" ~> buildWithAndroidEnv buildLibmozc LibMozc