forked from gosu/gosu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gosu.podspec
65 lines (54 loc) · 2.76 KB
/
Gosu.podspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
SDL2_PREFIX = `sdl2-config --prefix`.chomp
Pod::Spec.new do |s|
s.name = "Gosu"
s.version = "1.2.0"
s.summary = "2D game development library."
s.homepage = "https://www.libgosu.org/"
s.license = { type: "MIT", file: "COPYING" }
s.author = { "Julian Raschke" => "julian@raschke.de" }
s.documentation_url = "https://www.libgosu.org/cpp/"
s.source = { git: "https://github.com/gosu/gosu.git", tag: "v#{s.version}" }
# Bundle our dependencies into one subspec so that we can silence warnings for them.
s.subspec "Dependencies" do |ss|
ss.compiler_flags = "-Wno-everything"
# Be careful not to include SDL_sound on iOS, where Gosu still uses AudioToolbox instead.
ss.source_files = "dependencies/{stb,utf8proc}/**/*.{h,c}"
ss.osx.source_files = "dependencies/SDL_sound/**/*.{h,c}"
ss.osx.compiler_flags = "-I#{SDL2_PREFIX}/include/SDL2"
end
s.subspec "Gosu" do |ss|
ss.dependency "Gosu/Dependencies"
ss.osx.deployment_target = "10.12"
ss.ios.deployment_target = "12.0"
# Ignore Gosu using deprecated Gosu APIs internally.
# Compile all source files as Objective-C++ so we can use ObjC frameworks where necessary.
# Also silence warnings about invalid doxygen markup in SDL headers, and make deps available.
ss.compiler_flags = "-DGOSU_DEPRECATED= -Wno-documentation -x objective-c++ -Idependencies/stb -Idependencies/utf8proc"
ss.libraries = "iconv"
ss.frameworks = "AudioToolbox", "OpenAL"
# Include all frameworks necessary for SDL 2, because we link to it statically.
ss.osx.frameworks = "ApplicationServices", "AudioUnit", "Carbon", "Cocoa", "CoreAudio",
"ForceFeedback", "IOKit", "OpenGL"
ss.osx.weak_frameworks = "CoreHaptics", "GameController", "QuartzCore", "Metal"
# Frameworks used directly by Gosu for iOS.
ss.ios.frameworks = "AVFoundation", "CoreGraphics", "OpenGLES", "QuartzCore"
ss.osx.compiler_flags = "-I#{SDL2_PREFIX}/include/SDL2"
# Statically link SDL 2, so that compiled games will be self-contained.
ss.osx.xcconfig = { "OTHER_LDFLAGS" => "#{SDL2_PREFIX}/lib/libSDL2.a" }
ss.public_header_files = "include/Gosu/*.hpp"
ss.source_files = ["include/Gosu/*.hpp", "src/*.{hpp,cpp}"]
# Do not include FFI wrappers in the Pod project - this spec is for the C++ interface.
ss.exclude_files = "src/Constants.cpp", "src/*Wrapper.cpp"
# Gosu requires C++17 features and GNU extensions, but Xcode only uses gnu++14 by default.
ss.pod_target_xcconfig = {
'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++17',
'CLANG_CXX_LIBRARY' => 'libc++'
}
end
s.subspec "GosuAppDelegateMain" do |ss|
ss.dependency "Gosu/Gosu"
ss.source_files = "src/GosuAppDelegate.mm"
ss.platform = :ios, "8.0"
end
s.default_subspec = "Gosu"
end