summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Infra/Option.hs
diff options
context:
space:
mode:
authorJohn J. Camilleri <john@johnjcamilleri.com>2018-07-22 14:48:44 +0200
committerGitHub <noreply@github.com>2018-07-22 14:48:44 +0200
commit895b479564c36e5d686a16852556ba54dc84f2be (patch)
treea109720842569c61389f896627eecf427f157d2a /src/compiler/GF/Infra/Option.hs
parentcd1942a8454d569363b201f2345953e648ec9b53 (diff)
parent7f86bee8e708d88bd218b090eb23764ce37f50a6 (diff)
Merge pull request #8 from legalese/GF_LIB_PATH
GF_LIB_PATH can now be path1:path2:path3, not just 1path
Diffstat (limited to 'src/compiler/GF/Infra/Option.hs')
-rw-r--r--src/compiler/GF/Infra/Option.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/GF/Infra/Option.hs b/src/compiler/GF/Infra/Option.hs
index f68c7d121..27aa1c256 100644
--- a/src/compiler/GF/Infra/Option.hs
+++ b/src/compiler/GF/Infra/Option.hs
@@ -153,7 +153,7 @@ data Flags = Flags {
optLiteralCats :: Set Ident,
optGFODir :: Maybe FilePath,
optOutputDir :: Maybe FilePath,
- optGFLibPath :: Maybe FilePath,
+ optGFLibPath :: Maybe [FilePath],
optDocumentRoot :: Maybe FilePath, -- For --server mode
optRecomp :: Recomp,
optProbsFile :: Maybe FilePath,
@@ -208,9 +208,10 @@ parseModuleOptions args = do
then return opts
else errors $ map ("Non-option among module options: " ++) nonopts
-fixRelativeLibPaths curr_dir lib_dir (Options o) = Options (fixPathFlags . o)
+fixRelativeLibPaths curr_dir lib_dirs (Options o) = Options (fixPathFlags . o)
where
- fixPathFlags f@(Flags{optLibraryPath=path}) = f{optLibraryPath=concatMap (\dir -> [curr_dir </> dir, lib_dir </> dir]) path}
+ fixPathFlags f@(Flags{optLibraryPath=path}) = f{optLibraryPath=concatMap (\dir -> [parent </> dir
+ | parent <- curr_dir : lib_dirs]) path}
-- Showing options
@@ -423,7 +424,7 @@ optDescr =
literalCat x = set $ \o -> o { optLiteralCats = foldr Set.insert (optLiteralCats o) ((map identS . splitBy (==',')) x) }
lexicalCat x = set $ \o -> o { optLexicalCats = foldr Set.insert (optLexicalCats o) (splitBy (==',') x) }
outDir x = set $ \o -> o { optOutputDir = Just x }
- gfLibPath x = set $ \o -> o { optGFLibPath = Just x }
+ gfLibPath x = set $ \o -> o { optGFLibPath = Just $ splitInModuleSearchPath x }
gfDocuRoot x = set $ \o -> o { optDocumentRoot = Just x }
recomp x = set $ \o -> o { optRecomp = x }
probsFile x = set $ \o -> o { optProbsFile = Just x }