Minor clean up, taking hlint suggestions
[hadrian.git] / src / Settings / Builders / Cc.hs
1 module Settings.Builders.Cc (ccBuilderArgs) where
2
3 import Settings.Builders.Common
4
5 ccBuilderArgs :: Args
6 ccBuilderArgs = do
7 way <- getWay
8 builder Cc ? mconcat
9 [ getPkgDataList CcArgs
10 , getStagedSettingList ConfCcArgs
11 , cIncludeArgs
12
13 , builder (Cc CompileC) ? mconcat
14 [ arg "-Werror"
15 , Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNAMIC" ]
16 -- ref: mk/warning.mk:
17 -- SRC_CC_OPTS += -Wall $(WERROR)
18 , arg "-c", arg =<< getInput
19 , arg "-o", arg =<< getOutput ]
20
21 , builder (Cc FindCDependencies) ? do
22 output <- getOutput
23 mconcat [ arg "-E"
24 , arg "-MM", arg "-MG"
25 , arg "-MF", arg output
26 , arg "-MT", arg $ dropExtension output -<.> "o"
27 , arg "-x", arg "c"
28 , arg =<< getInput ] ]