Commit 2716b347 authored by Eloy Duran's avatar Eloy Duran

Add the '-ObjC -all_load' linker flags by default. Closes #6.

parent 19029672
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
513D6140144F6D3600A8A360 /* ShellScript */ = { 513D6140144F6D3600A8A360 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 12;
files = ( files = (
); );
inputPaths = ( inputPaths = (
......
...@@ -20,11 +20,12 @@ module Pod ...@@ -20,11 +20,12 @@ module Pod
def xcconfig def xcconfig
@xcconfig ||= Xcode::Config.new({ @xcconfig ||= Xcode::Config.new({
# In a workspace this is where the static library headers should be found # In a workspace this is where the static library headers should be found.
# We could also make this recursive, but let's let the user decide on that.
'USER_HEADER_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods"', 'USER_HEADER_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods"',
# search the user headers
'ALWAYS_SEARCH_USER_PATHS' => 'YES', 'ALWAYS_SEARCH_USER_PATHS' => 'YES',
# This makes categories from static libraries work, which many libraries
# require, so we add these by default.
'OTHER_LDFLAGS' => '-ObjC -all_load',
}) })
end end
......
require File.expand_path('../../spec_helper', __FILE__) require File.expand_path('../../spec_helper', __FILE__)
describe "Pod::Installer" do describe "Pod::Installer" do
describe ", by default," do
before do
@xcconfig = Pod::Installer.new(Pod::Spec.new).xcconfig.to_hash
end
it "sets the header search paths where installed Pod headers can be found" do
@xcconfig['USER_HEADER_SEARCH_PATHS'].should == '"$(BUILT_PRODUCTS_DIR)/Pods"'
@xcconfig['ALWAYS_SEARCH_USER_PATHS'].should == 'YES'
end
it "configures the project to load categories from the static library" do
@xcconfig['OTHER_LDFLAGS'].should == '-ObjC -all_load'
end
end
before do before do
config.project_pods_root = fixture('integration') config.project_pods_root = fixture('integration')
fixture('spec-repos/master') # ensure the archive is unpacked fixture('spec-repos/master') # ensure the archive is unpacked
...@@ -38,7 +53,8 @@ describe "Pod::Installer" do ...@@ -38,7 +53,8 @@ describe "Pod::Installer" do
'"$(BUILT_PRODUCTS_DIR)/Pods/ASIHTTPRequest" ' \ '"$(BUILT_PRODUCTS_DIR)/Pods/ASIHTTPRequest" ' \
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"', '"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"',
"ALWAYS_SEARCH_USER_PATHS" => "YES", "ALWAYS_SEARCH_USER_PATHS" => "YES",
"OTHER_LDFLAGS" => "-framework SystemConfiguration -framework CFNetwork " \ "OTHER_LDFLAGS" => "-ObjC -all_load " \
"-framework SystemConfiguration -framework CFNetwork " \
"-framework MobileCoreServices -l z.1" "-framework MobileCoreServices -l z.1"
} }
], ],
...@@ -49,7 +65,8 @@ describe "Pod::Installer" do ...@@ -49,7 +65,8 @@ describe "Pod::Installer" do
{ {
"USER_HEADER_SEARCH_PATHS" => '"$(BUILT_PRODUCTS_DIR)/Pods" ' \ "USER_HEADER_SEARCH_PATHS" => '"$(BUILT_PRODUCTS_DIR)/Pods" ' \
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"', '"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"',
"ALWAYS_SEARCH_USER_PATHS" => "YES" "ALWAYS_SEARCH_USER_PATHS" => "YES",
"OTHER_LDFLAGS" => "-ObjC -all_load"
} }
], ],
[ [
...@@ -62,7 +79,8 @@ describe "Pod::Installer" do ...@@ -62,7 +79,8 @@ describe "Pod::Installer" do
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"', '"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"',
"ALWAYS_SEARCH_USER_PATHS" => "YES", "ALWAYS_SEARCH_USER_PATHS" => "YES",
"HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2", "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2",
"OTHER_LDFLAGS" => "-l xml2.2.7.3 -framework SystemConfiguration " \ "OTHER_LDFLAGS" => "-ObjC -all_load " \
"-l xml2.2.7.3 -framework SystemConfiguration " \
"-framework CFNetwork -framework MobileCoreServices -l z.1" "-framework CFNetwork -framework MobileCoreServices -l z.1"
} }
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment