Add Werror to CC and HC (#309)
[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 = builder Cc ? mconcat
7 [ append =<< getPkgDataList CcArgs
8 , argSettingList . ConfCcArgs =<< getStage
9 , cIncludeArgs
10
11 , builder (Cc CompileC) ? mconcat [ arg "-Werror"
12 -- mk/warning.mk:
13 -- SRC_CC_OPTS += -Wall $(WERROR)
14 , arg "-c", arg =<< getInput
15 , arg "-o", arg =<< getOutput ]
16
17 , builder (Cc FindCDependencies) ? do
18 output <- getOutput
19 mconcat [ arg "-E"
20 , arg "-MM", arg "-MG"
21 , arg "-MF", arg output
22 , arg "-MT", arg $ dropExtension output -<.> "o"
23 , arg "-x", arg "c"
24 , arg =<< getInput ] ]