axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
922 stars 205 forks source link

Somethings to be fixed #1453

Closed paulocoutinhox closed 10 months ago

paulocoutinhox commented 11 months ago

Somethings to be fixed:

and if is portrait:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
paulocoutinhox commented 11 months ago

More one screenshot if help:

image
neo-godlike commented 11 months ago

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.

paulocoutinhox commented 11 months ago

Sure, im using a simple project from axmol template, changed nothing:

image

The path on image is: /Users/paulo/Developer/workspaces/cpp/axmol/thirdparty/zlib/prebuilt/tvos/libz.a

neo-godlike commented 11 months ago

It seems to be incorrect. Could you please try removing those two, and then manually add the libz.tbd as I suggested?

paulocoutinhox commented 11 months ago

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:

image

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.

halx99 commented 11 months ago

@paulocoutinhox I have done what I can do, PRs for fixing unresolved issues from you are appreciated

paulocoutinhox commented 11 months ago

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.

paulocoutinhox commented 11 months ago

Im doing some updates according to this issue. I will publish in some hours my updates related to things here.

paulocoutinhox commented 11 months ago

My pr: https://github.com/axmolengine/axmol/pull/1456

paulocoutinhox commented 11 months ago

I checked above all what i need since it is merged now.

paulocoutinhox commented 11 months ago

Need only two things now:

halx99 commented 11 months ago
paulocoutinhox commented 11 months ago

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:

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.

halx99 commented 11 months ago

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

paulocoutinhox commented 11 months ago

@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 commented 11 months ago

@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.

rh101 commented 11 months ago

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: image

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: image

paulocoutinhox commented 11 months ago

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:

paulocoutinhox commented 11 months ago

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'
halx99 commented 11 months ago

But the ci not report this warning, why?

https://github.com/axmolengine/axmol/actions/runs/7139108291/job/19441837256

rh101 commented 11 months ago

@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'

halx99 commented 11 months ago

@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.

halx99 commented 10 months ago

close by #1453

halx99 commented 10 months ago

for duplicated zlib, refer : https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8946