Closed paulocoutinhox closed 10 months ago
More one screenshot if help:
Please confirm that you have correctly linked libz. You can try adding -lz to the other_link_flag, or add libz.tbd to Link Binary With Libraries in the Build Phases.
Sure, im using a simple project from axmol template, changed nothing:
The path on image is: /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/zlib/prebuilt/tvos/libz.a
It seems to be incorrect. Could you please try removing those two, and then manually add the libz.tbd as I suggested?
Sure. In the end of the list, already has "libz.tbd". I removed all libz.a and leave only "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk/usr/lib/libz.tbd" and it worked:
Also, there is a duplicated "libaxmol.a" that generate the warning too.
When removed libz.a and one of two libaxmol.a it stop emit the warnings.
The other errors above still.
@paulocoutinhox I have done what I can do, PRs for fixing unresolved issues from you are appreciated
No problem. Im focusing now in publish my game for iOS, iPad and tvOS to Apple. All things that i found about problems im putting here because others will get these problems too.
The only blocking issue is the problem with PNG library that prevent app to be compiled to tvOS.
Im doing some updates according to this issue. I will publish in some hours my updates related to things here.
I checked above all what i need since it is merged now.
Need only two things now:
register_all_packages
a static empty method, maybe it can be removedHi,
1 - Can i made a PR to clear it? https://github.com/axmolengine/axmol/blob/dev/templates/cpp-template-default/Source/AppDelegate.cpp#L56-L61 2 - You have some options for this kind of problem inside Apple that are:
https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake#L353-L374
https://github.com/tdlib/td/blob/master/CMake/iOS.cmake#L66-L119
Do a lipo to join all simulators x64 and arm64 into one lib and after, create the xcframework:
xcodebuild -create-xcframework \
-library ./libxyz_macos.a \
-headers ./include/ \
-library ./libxyz_iossimulator.a \
-headers ./include/ \
-library ./libxyz_maccatalyst.a \
-headers ./include/ \
-library ./libxyz_ios.a \
-headers ./include/ \
-output XYZ.xcframework
Thanks.
Hi,
1 - Can i made a PR to clear it? https://github.com/axmolengine/axmol/blob/dev/templates/cpp-template-default/Source/AppDelegate.cpp#L56-L61 2 - You have some options for this kind of problem inside Apple that are:
- Create a library for each platform and use cmake platform selector to specify the correct library for each:
https://github.com/leetal/ios-cmake/blob/master/ios.toolchain.cmake#L353-L374
- Create an IF that check effective platform, example:
https://github.com/tdlib/td/blob/master/CMake/iOS.cmake#L66-L119
- Create a xcframework that is a simple command that unify all .a or .so or .dylib files after you use lipo:
Do a lipo to join all simulators x64 and arm64 into one lib and after, create the xcframework:
xcodebuild -create-xcframework \ -library ./libxyz_macos.a \ -headers ./include/ \ -library ./libxyz_iossimulator.a \ -headers ./include/ \ -library ./libxyz_maccatalyst.a \ -headers ./include/ \ -library ./libxyz_ios.a \ -headers ./include/ \ -output XYZ.xcframework
Thanks.
nice, the cmake latest already support link aginst .xcframework
@aismann can you help with the .xcframework
part of prebuilt or lipo de simulator (x64, arm64) into you library and the device (x64, arm64) into another library? thanks.
@aismann can you help with the
.xcframework
part of prebuilt or lipo de simulator (x64, arm64) into you library and the device (x64, arm64) into another library? thanks.
Im not having OSX, Apple or something like this . And always no time.
Do a lipo to join all simulators x64 and arm64 into one lib and after, create the xcframework:
xcodebuild -create-xcframework \ -library ./libxyz_macos.a \ -headers ./include/ \ -library ./libxyz_iossimulator.a \ -headers ./include/ \ -library ./libxyz_maccatalyst.a \ -headers ./include/ \ -library ./libxyz_ios.a \ -headers ./include/ \ -output XYZ.xcframework
If you're going to generate the .xcframework
for this, then it is best to stick to what seems to be the convention for naming:
The above screenshot is from Firebase Crashlytics, and Facebook SDK also uses the same format. The actual libraries within the folders don't have suffixes though. For example:
You dont need worry about this, the xcframework creator generate the folders automatically, you don't set the folders/contents manually. You can see on my other projects:
The problem with zlib still happen with dev
branch:
Ld /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/bin/layerbug/Debug/layerbug.app/Contents/MacOS/layerbug normal (in target 'layerbug' from project 'layerbug')
cd /Users/paulo/Developer/workspaces/cpp/layerbug
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Xlinker -reproducible -target arm64-apple-macos13.6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -O0 -L/Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/build/EagerLinkingTBDs/Debug -L/Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/bin/layerbug/Debug -F/Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/build/EagerLinkingTBDs/Debug -F/Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/bin/layerbug/Debug -filelist /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/build/layerbug.build/Debug/Objects-normal/arm64/layerbug.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -object_path_lto -Xlinker /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/build/layerbug.build/Debug/Objects-normal/arm64/layerbug_lto.o -Xlinker -no_deduplicate -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libaxmol.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libJSONDefault.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libcocostudio.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libSDFGen.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libInspector.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libImGui.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libfairygui.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libDragonBones.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libspine.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libphysics-nodes.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libparticle3d.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libassets-manager.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libGUI.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libaxmol.a /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/zlib/_d/lib/mac/libz.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libbox2d.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libchipmunk.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libfreetype.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libpng.a /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/zlib/_d/lib/mac/libz.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/librecast.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libbullet.a /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/jpeg-turbo/_d/lib/mac/libjpeg.a /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/openssl/_d/lib/mac/libcrypto.a /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/openssl/_d/lib/mac/libssl.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libwebp.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libpugixml.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libxxhash.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libfastlz.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libclipper2.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libConvertUTF.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libpoly2tri.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libastcenc.a /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/curl/_d/lib/mac/libcurl.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libogg.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libglfw.a -framework Cocoa -framework IOKit -framework CoreFoundation -lpthread /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libunzip.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libllhttp.a /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libsimdjson.a -framework Cocoa -framework OpenGL -framework ApplicationServices -framework IOKit -framework OpenAL -framework AudioToolbox -framework QuartzCore -framework Foundation -framework GameController -framework Metal -framework CoreVideo -framework AVFoundation -framework CoreMedia -framework AppKit -framework AudioUnit -framework CoreAudio -framework SystemConfiguration -Xlinker -dependency_info -Xlinker /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/build/layerbug.build/Debug/Objects-normal/arm64/layerbug_dependency_info.dat -o /Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/bin/layerbug/Debug/layerbug.app/Contents/MacOS/layerbug
ld: warning: ignoring duplicate libraries: '/Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/zlib/_d/lib/mac/libz.a', '/Users/paulo/Developer/workspaces/cpp/layerbug/build_arm64/lib/Debug/libaxmol.a'
But the ci not report this warning, why?
https://github.com/axmolengine/axmol/actions/runs/7139108291/job/19441837256
@paulocoutinhox @halx99 I don't see that warningwhen building for iOS or MacOS targets on a Mac M1 Mini (Ventura 13.6.1).
Never-mind, I just noticed it at the end of the log in Xcode:
Ignoring duplicate libraries: '/Users/***/dev/game_engines/axmol/thirdparty/zlib/_d/lib/mac/libz.a', '/Users/***/dev/test1/build_arm64/lib/Debug/libaxmol.a'
Building cpp-tests project with axmol build
command:
ld: warning: ignoring duplicate libraries: '/Users/***/dev/game_engines/axmol/tests/cpp-tests/build_arm64/lib/Release/libaxmol.a', '/Users/***/dev/game_engines/axmol/thirdparty/zlib/_d/lib/mac/libz.a'
@paulocoutinhox @halx99 ~I don't see that warningwhen building for iOS or MacOS targets on a Mac M1 Mini (Ventura 13.6.1).~
Never-mind, I just noticed it at the end of the log in Xcode:
Ignoring duplicate libraries: '/Users/***/dev/game_engines/axmol/thirdparty/zlib/_d/lib/mac/libz.a', '/Users/***/dev/test1/build_arm64/lib/Debug/libaxmol.a'
Building cpp-tests project with
axmol build
command:ld: warning: ignoring duplicate libraries: '/Users/***/dev/game_engines/axmol/tests/cpp-tests/build_arm64/lib/Release/libaxmol.a', '/Users/***/dev/game_engines/axmol/thirdparty/zlib/_d/lib/mac/libz.a'
reproduced too, I have no idea why xcode emit the warnings yet.
close by #1453
for duplicated zlib, refer : https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8946
Somethings to be fixed:
[x] Typo inside : https://github.com/axmolengine/axmol/blob/ed2d199befc16a36800ec32c85df3223639d5aba/templates/cpp-template-default/proj.ios_mac/ios/exportoptions.plist#L12 (Prifile => Profile)
[x] Portrait project is using Landscape Splash: https://github.com/axmolengine/axmol/blob/ed2d199befc16a36800ec32c85df3223639d5aba/templates/cpp-template-default/proj.ios_mac/ios/LaunchScreenBackground.png (can you add one for portrait?)
[x] Error when run tvOS sample:
[ ] Warning that two libs have same libraries:
ld: warning: ignoring duplicate libraries: '/Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/zlib/prebuilt/tvos/libz.a', '/Users/paulo/Developer/workspaces/cpp/growsquare/build_tvos_arm64/lib/Debug/libaxmol.a'
[x] The macOS project still have the cocos2d icon instead of axmol:
[x] Suggestion: Rename this method to follow camel case (register_all_packages => registerAllPackages): https://github.com/axmolengine/axmol/blob/dev/templates/cpp-template-default/Source/AppDelegate.cpp#L58
[x] When create a new ios/tvos project CMakeLists bundle id is not replaced like in Android: https://github.com/axmolengine/axmol/blob/dev/templates/cpp-template-default/CMakeLists.txt#L189
[ ] Add support for arm64 simulator for ios/tvos, today only x86_64 works
[x] Replace "gamepad" by "extendedGamepad":
[x] Add support for ios and ipad in CMakeLists.txt:
set_xcode_property(${APP_NAME} TARGETED_DEVICE_FAMILY "1,2")
[x] Add non exempt in proj.ios_mac/ios/targets/ios/Info.plist:
[x] Add require full screen for prevent iPad error when publish to Apple (https://stackoverflow.com/questions/32559724/ipad-multitasking-support-requires-these-orientations):
[x] I dont know if it is implemented, but is landscape is selected, the Info.plist need have:
and if is portrait: