Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 34afcb7

Browse files
author
Alex Ames
committed
Fixed the mac build for the sample project.
The generic template now includes the proper C++ source files and links against the right frameworks, and fixed a few compile-time errors when building the mac targets. Change-Id: I17ebd2feb9e6000ffbe7bebb0ab5c96ecd2d8c73
1 parent d69bc3f commit 34afcb7

File tree

6 files changed

+87
-19
lines changed

6 files changed

+87
-19
lines changed

admob/Classes/FirebaseAdMobScene.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,25 @@ static int adViewPositionIndex = 0;
7575
// The AdMob app IDs.
7676
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
7777
const char* kAdMobAppID = "ca-app-pub-3940256099942544~3347511713";
78-
#endif
79-
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
78+
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
8079
const char* kAdMobAppID = "ca-app-pub-3940256099942544~1458002511";
80+
#else
81+
const char* kAdMobAppID = "";
8182
#endif
8283

8384
// These ad units are configured to always serve test ads.
8485
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
8586
const char* kAdViewAdUnit = "ca-app-pub-3940256099942544/6300978111";
8687
const char* kInterstitialAdUnit = "ca-app-pub-3940256099942544/1033173712";
87-
const char* kRewardedVideoAdUnit = "YOUR_AD_UNIT_ID";
88+
const char* kRewardedVideoAdUnit = "ca-app-pub-3940256099942544/2888167318";
8889
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
8990
const char* kAdViewAdUnit = "ca-app-pub-3940256099942544/2934735716";
9091
const char* kInterstitialAdUnit = "ca-app-pub-3940256099942544/4411468910";
91-
const char* kRewardedVideoAdUnit = "YOUR_AD_UNIT_ID";
92+
const char* kRewardedVideoAdUnit = "ca-app-pub-3940256099942544/6386090517";
9293
#else
9394
const char* kAdViewAdUnit = "";
9495
const char* kInterstitialAdUnit = "";
95-
const char* kRewardedVideoAdUnit = "YOUR_AD_UNIT_ID";
96+
const char* kRewardedVideoAdUnit = "";
9697
#endif
9798

9899
// The ad view's ad size.

common/Classes/FirebaseScene.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ void FirebaseScene::logMessage(std::string format, ...) {
176176
WindowContext getWindowContext() {
177177
return (id)Director::getInstance()->getOpenGLView()->getEAGLView();
178178
}
179-
#endif
180-
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
179+
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
181180
// Returns the Android Activity.
182181
WindowContext getWindowContext() { return JniHelper::getActivity(); }
182+
#else
183+
WindowContext getWindowContext() { return nullptr; }
183184
#endif

common/project_template_files/project.pbxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
521A8EAA19F11F5000D177D7 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 521A8EA819F11F5000D177D7 /* fonts */; };
6767
52B47A471A53D09C004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A461A53D09B004E4C60 /* Security.framework */; };
6868
8262943E1AAF051F00CB7CF7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8262943D1AAF051F00CB7CF7 /* Security.framework */; };
69+
984CE8671E81F58A00A6F405 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 984CE8661E81F58A00A6F405 /* MediaPlayer.framework */; };
70+
9853ECBE1E81C6D300B68892 /* Firebase{FIREBASE_FEATURE_CAMELCASE}Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0566191DB70C58009CE39C /* Firebase{FIREBASE_FEATURE_CAMELCASE}Scene.cpp */; };
71+
9853ECBF1E81C6D300B68892 /* FirebaseScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A05661C1DB70C58009CE39C /* FirebaseScene.cpp */; };
72+
9853ECC51E81C6E000B68892 /* firebase_{FIREBASE_FEATURE}.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9853ECC31E81C6E000B68892 /* firebase_{FIREBASE_FEATURE}.framework */; };
73+
9853ECC61E81C6E000B68892 /* firebase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9853ECC41E81C6E000B68892 /* firebase.framework */; };
6974
BF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB012928DE900B8313A /* OpenGLES.framework */; };
7075
BF1712471292920000B8313A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; };
7176
BF1C47F01293687400B63C5D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1C47EA1293683800B63C5D /* QuartzCore.framework */; };
@@ -169,6 +174,9 @@
169174
521A8EA819F11F5000D177D7 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = ""; };
170175
52B47A461A53D09B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
171176
8262943D1AAF051F00CB7CF7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
177+
9853ECC31E81C6E000B68892 /* firebase_{FIREBASE_FEATURE}.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = firebase_{FIREBASE_FEATURE}.framework; path = ../Libs/firebase_cpp_sdk/frameworks/darwin/firebase_{FIREBASE_FEATURE}.framework; sourceTree = ""; };
178+
984CE8661E81F58A00A6F405 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
179+
9853ECC41E81C6E000B68892 /* firebase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = firebase.framework; path = ../Libs/firebase_cpp_sdk/frameworks/darwin/firebase.framework; sourceTree = ""; };
172180
BF170DB012928DE900B8313A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
173181
BF170DB412928DE900B8313A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
174182
BF1C47EA1293683800B63C5D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
@@ -185,6 +193,7 @@
185193
isa = PBXFrameworksBuildPhase;
186194
buildActionMask = 2147483647;
187195
files = (
196+
984CE8671E81F58A00A6F405 /* MediaPlayer.framework in Frameworks */,
188197
4A0566211DB70CDD009CE39C /* GameController.framework in Frameworks */,
189198
294D0D641D0D56D500F7F5D4 /* CoreText.framework in Frameworks */,
190199
ED545A7C1B68A1F400C3958E /* libiconv.dylib in Frameworks */,
@@ -209,6 +218,8 @@
209218
isa = PBXFrameworksBuildPhase;
210219
buildActionMask = 2147483647;
211220
files = (
221+
9853ECC51E81C6E000B68892 /* firebase_{FIREBASE_FEATURE}.framework in Frameworks */,
222+
9853ECC61E81C6E000B68892 /* firebase.framework in Frameworks */,
212223
ED545A7E1B68A1FA00C3958E /* libiconv.dylib in Frameworks */,
213224
1AC6FB21180E996B004C840B /* libcocos2d Mac.a in Frameworks */,
214225
5087E76717EB910900C73F5D /* libz.dylib in Frameworks */,
@@ -277,6 +288,9 @@
277288
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
278289
isa = PBXGroup;
279290
children = (
291+
984CE8661E81F58A00A6F405 /* MediaPlayer.framework */,
292+
9853ECC31E81C6E000B68892 /* firebase_{FIREBASE_FEATURE}.framework */,
293+
9853ECC41E81C6E000B68892 /* firebase.framework */,
280294
4A0566221DB70D15009CE39C /* firebase_{FIREBASE_FEATURE}.framework */,
281295
4A0566231DB70D15009CE39C /* firebase.framework */,
282296
4A0566201DB70CDD009CE39C /* GameController.framework */,
@@ -537,6 +551,8 @@
537551
isa = PBXSourcesBuildPhase;
538552
buildActionMask = 2147483647;
539553
files = (
554+
9853ECBE1E81C6D300B68892 /* Firebase{FIREBASE_FEATURE_CAMELCASE}Scene.cpp in Sources */,
555+
9853ECBF1E81C6D300B68892 /* FirebaseScene.cpp in Sources */,
540556
46880B8919C43A87006E1F66 /* AppDelegate.cpp in Sources */,
541557
503AE10517EB98FF00D1A890 /* main.cpp in Sources */,
542558
);
@@ -633,6 +649,7 @@
633649
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
634650
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
635651
CLANG_CXX_LIBRARY = "libc++";
652+
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../Libs/firebase_cpp_sdk/frameworks/darwin/";
636653
GCC_DYNAMIC_NO_PIC = NO;
637654
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
638655
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -664,6 +681,7 @@
664681
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
665682
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
666683
CLANG_CXX_LIBRARY = "libc++";
684+
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../Libs/firebase_cpp_sdk/frameworks/darwin/";
667685
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
668686
GCC_PRECOMPILE_PREFIX_HEADER = YES;
669687
GCC_PREFIX_HEADER = mac/Prefix.pch;

0 commit comments

Comments
 (0)