Skip to content

Commit

Permalink
Added support for Mac OS X projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Keniger committed Apr 15, 2013
1 parent 5a6814c commit 2567694
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
0.7.13
-----
* Added support for Mac OS X kits

0.7.7
-----
* No longer crashes Xcode when a new kit project is generated.
Expand Down
12 changes: 8 additions & 4 deletions Kit/Project.hs
Expand Up @@ -34,9 +34,13 @@ kitUpdateMakeFile = "kit: Kit.xcconfig\n" ++
"\tcd .. && kit update && exit 1\n"

prefixDefault :: String
prefixDefault = "#ifdef __OBJC__\n" ++
" #import <Foundation/Foundation.h>\n" ++
" #import <UIKit/UIKit.h>\n" ++
prefixDefault = "#ifdef __OBJC__\n" ++
" #import <Foundation/Foundation.h>\n" ++
" #if TARGET_OS_MAC\n" ++
" #import <Cocoa/Cocoa.h>\n" ++
" #else\n" ++
" #import <UIKit/UIKit.h>\n" ++
" #endif\n" ++
"#endif\n"

data KitProject = KitProject {
Expand Down Expand Up @@ -68,7 +72,7 @@ makeKitProject kitsContents depsOnlyConfig =
header = createHeader kitsContents
config = createConfig kitsContents
-- TODO: Make this specify an xcconfig data type
depsConfig = "#include \"" ++ xcodeConfigFile ++ "\"\n\nSKIP_INSTALL=YES\n\n" ++ fromMaybe "" depsOnlyConfig
depsConfig = "#include \"" ++ xcodeConfigFile ++ "\"\n\nSKIP_INSTALL=YES\nSDKROOT=iphoneos\n\n" ++ fromMaybe "" depsOnlyConfig
resources = mapMaybe resourceLink kitsContents
in KitProject pf header config depsConfig resources
where createProjectFile cs = let
Expand Down
2 changes: 0 additions & 2 deletions Kit/Xcode/ProjectFileTemplate.hs
Expand Up @@ -96,12 +96,10 @@ buildConfigurations libDirs = let libSearch = librarySearchPaths libDirs in [
"GCC_C_LANGUAGE_STANDARD" ~> val "c99",
"GCC_OPTIMIZATION_LEVEL" ~> val "0",
"OTHER_LDFLAGS" ~> val "-ObjC",
"SDKROOT" ~> val "iphoneos",
libSearch ]
, buildConfiguration "Release" (Just kitConfigRefUUID) [
"GCC_C_LANGUAGE_STANDARD" ~> val "c99",
"OTHER_LDFLAGS" ~> val "-ObjC",
"SDKROOT" ~> val "iphoneos",
libSearch
]],
"defaultConfigurationIsVisible" ~> val "0",
Expand Down
2 changes: 1 addition & 1 deletion kit.cabal
@@ -1,5 +1,5 @@
name: kit
version: 0.7.12
version: 0.7.13
cabal-version: >=1.6
build-type: Simple
license: BSD3
Expand Down

0 comments on commit 2567694

Please sign in to comment.