Skip to content
Snippets Groups Projects
Commit f0d5cdde authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

Ensure that OS X framework headers are in include path

This fixes #2689.
parent d8fa4618
No related branches found
No related tags found
No related merge requests found
......@@ -346,7 +346,9 @@ componentCcGhcOptions verbosity implInfo lbi bi clbi pref filename =
ghcOptInputFiles = toNubListR [filename],
ghcOptCppIncludePath = toNubListR $ [autogenModulesDir lbi, odir]
++ PD.includeDirs bi,
++ PD.includeDirs bi
++ ["/System/Library/Frameworks/"++fw++"/Headers"
| isOSX, fw <- PD.frameworks bi ],
ghcOptPackageDBs = withPackageDB lbi,
ghcOptPackages = toNubListR $ mkGhcOptPackages clbi,
ghcOptCcOptions = toNubListR $
......@@ -362,6 +364,7 @@ componentCcGhcOptions verbosity implInfo lbi bi clbi pref filename =
ghcOptObjDir = toFlag odir
}
where
isOSX = case buildOS of OSX -> True; _ -> False
odir | hasCcOdirBug implInfo = pref </> takeDirectory filename
| otherwise = pref
-- ghc 6.4.0 had a bug in -odir handling for C compilations.
......@@ -385,7 +388,9 @@ componentGhcOptions verbosity lbi bi clbi odir =
ghcOptSourcePath = toNubListR $ [odir] ++ (hsSourceDirs bi)
++ [autogenModulesDir lbi],
ghcOptCppIncludePath = toNubListR $ [autogenModulesDir lbi, odir]
++ PD.includeDirs bi,
++ PD.includeDirs bi
++ ["/System/Library/Frameworks/"++fw++"/Headers"
| isOSX, fw <- PD.frameworks bi ],
ghcOptCppOptions = toNubListR $ cppOptions bi,
ghcOptCppIncludes = toNubListR $
[autogenModulesDir lbi </> cppHeaderName],
......@@ -403,6 +408,8 @@ componentGhcOptions verbosity lbi bi clbi odir =
ghcOptExtensionMap = M.fromList . compilerExtensions $ (compiler lbi)
}
where
isOSX = case buildOS of OSX -> True; _ -> False
toGhcOptimisation NoOptimisation = mempty --TODO perhaps override?
toGhcOptimisation NormalOptimisation = toFlag GhcNormalOptimisation
toGhcOptimisation MaximumOptimisation = toFlag GhcMaximumOptimisation
......
......@@ -410,6 +410,9 @@ ppHsc2hs bi lbi =
| isOSX
, opt <- nub (concatMap Installed.frameworkDirs pkgs)
, what <- ["--cflag", "--lflag"] ]
++ [ "--cflag=-I/System/Library/Frameworks/" ++ opt ++ "/Headers"
| isOSX
, opt <- nub (concatMap Installed.frameworks pkgs) ]
++ [ "--lflag=" ++ arg
| isOSX
, opt <- PD.frameworks bi ++ concatMap Installed.frameworks pkgs
......
......@@ -10,6 +10,7 @@
respetively (GHC's '-fprof-auto-{exported,top}' flags) (#193).
* New 'custom-setup' stanza to specify setup deps. Setup is also built
with the cabal_macros.h style macros, for conditional compilation.
* Include Mac OS X framework headers in include path
1.22.0.0 Johan Tibell <johan.tibell@gmail.com> January 2015
* Support GHC 7.10.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment