@@ -34,7 +34,7 @@ import Development.Shake.FilePath ( (</>)
34
34
, exe
35
35
, splitDirectories
36
36
)
37
- import Numeric ( showHex )
37
+ import Numeric ( showHex )
38
38
import Options.Applicative ( Parser
39
39
, (<**>)
40
40
, (<|>)
@@ -435,7 +435,9 @@ runArguments =
435
435
<*> optional
436
436
(many
437
437
(strArgument
438
- (metavar " ARGS" <> help " Arguments to the executable(s) (should follow '--')" )
438
+ ( metavar " ARGS"
439
+ <> help " Arguments to the executable(s) (should follow '--')"
440
+ )
439
441
)
440
442
)
441
443
@@ -462,11 +464,16 @@ testArguments =
462
464
)
463
465
)
464
466
<*> optional
465
- (strOption (long " target" <> metavar " TARGET" <> help " Name of the test to run" ))
467
+ (strOption
468
+ (long " target" <> metavar " TARGET" <> help " Name of the test to run"
469
+ )
470
+ )
466
471
<*> optional
467
472
(many
468
473
(strArgument
469
- (metavar " ARGS" <> help " Arguments to the test(s) (should follow '--')" )
474
+ ( metavar " ARGS"
475
+ <> help " Arguments to the test(s) (should follow '--')"
476
+ )
470
477
)
471
478
)
472
479
@@ -591,8 +598,8 @@ toml2AppSettings tomlSettings args = do
591
598
(tomlSettingsExecutables tomlSettings)
592
599
projectName
593
600
testSettings <- getTestSettings $ tomlSettingsTests tomlSettings
594
- flags <- defineFlags specifiedFlags compiler release
595
- buildPrefix <- makeBuildPrefix compiler flags
601
+ flags <- defineFlags specifiedFlags compiler release
602
+ buildPrefix <- makeBuildPrefix compiler flags
596
603
let dependencies = tomlSettingsDependencies tomlSettings
597
604
let devDependencies = tomlSettingsDevDependencies tomlSettings
598
605
return AppSettings { appSettingsCompiler = compiler
@@ -608,11 +615,55 @@ toml2AppSettings tomlSettings args = do
608
615
609
616
defineFlags :: [String ] -> FilePath -> Bool -> IO [String ]
610
617
defineFlags [] compiler release
611
- | " gfortran" `isInfixOf` compiler = return $ if release then [ " -Wall" , " -Wextra" , " -Wimplicit-interface" , " -fPIC" , " -fmax-errors=1" , " -O3" , " -march=native" , " -ffast-math" , " -funroll-loops" ] else [ " -Wall" , " -Wextra" , " -Wimplicit-interface" , " -fPIC" , " -fmax-errors=1" , " -g" , " -fbounds-check" , " -fcheck-array-temporaries" , " -fbacktrace" ]
612
- | " caf" `isInfixOf` compiler = return $ if release then [ " -Wall" , " -Wextra" , " -Wimplicit-interface" , " -fPIC" , " -fmax-errors=1" , " -O3" , " -march=native" , " -ffast-math" , " -funroll-loops" ] else [ " -Wall" , " -Wextra" , " -Wimplicit-interface" , " -fPIC" , " -fmax-errors=1" , " -g" , " -fbounds-check" , " -fcheck-array-temporaries" , " -fbacktrace" ]
618
+ | " gfortran" `isInfixOf` compiler = return $ if release
619
+ then
620
+ [ " -Wall"
621
+ , " -Wextra"
622
+ , " -Wimplicit-interface"
623
+ , " -fPIC"
624
+ , " -fmax-errors=1"
625
+ , " -O3"
626
+ , " -march=native"
627
+ , " -ffast-math"
628
+ , " -funroll-loops"
629
+ ]
630
+ else
631
+ [ " -Wall"
632
+ , " -Wextra"
633
+ , " -Wimplicit-interface"
634
+ , " -fPIC"
635
+ , " -fmax-errors=1"
636
+ , " -g"
637
+ , " -fbounds-check"
638
+ , " -fcheck-array-temporaries"
639
+ , " -fbacktrace"
640
+ ]
641
+ | " caf" `isInfixOf` compiler = return $ if release
642
+ then
643
+ [ " -Wall"
644
+ , " -Wextra"
645
+ , " -Wimplicit-interface"
646
+ , " -fPIC"
647
+ , " -fmax-errors=1"
648
+ , " -O3"
649
+ , " -march=native"
650
+ , " -ffast-math"
651
+ , " -funroll-loops"
652
+ ]
653
+ else
654
+ [ " -Wall"
655
+ , " -Wextra"
656
+ , " -Wimplicit-interface"
657
+ , " -fPIC"
658
+ , " -fmax-errors=1"
659
+ , " -g"
660
+ , " -fbounds-check"
661
+ , " -fcheck-array-temporaries"
662
+ , " -fbacktrace"
663
+ ]
613
664
| otherwise = do
614
- putStrLn $ " Sorry, compiler is currently unsupported: " ++ compiler
615
- exitWith (ExitFailure 1 )
665
+ putStrLn $ " Sorry, compiler is currently unsupported: " ++ compiler
666
+ exitWith (ExitFailure 1 )
616
667
defineFlags specifiedFlags _ _ = return specifiedFlags
617
668
618
669
getLibrarySettings :: Maybe Library -> IO (Maybe Library )
0 commit comments