[ad_1]
After i add some libs in construct phases->hyperlink binary with libraries . I attempt to construct challenge once more by utilizing cocos creator construct software. I opened challenge xcode once more. In construct phases->hyperlink binary with libraries , it was empty.
Is there any solution to repair this downside?
That you must edit:native/engine/ios/CMakeLists.txt
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppTrackingTransparency")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Safety")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework StoreKit")
Hope this may remedy your concern.
1 Like
I attempted it. it didn’t work @stark2022
I already know the issue why each time I rebuild, this area is empty. That’s as a result of I selected the choice skip xcode replace . However I nonetheless need to understand how if I construct a brand new xcode challenge it could mechanically add the library
The reply from @stark2022 ought to work.
And right here a modernized is manner
#...
cc_ios_after_target(${EXECUTABLE_NAME})
target_link_libraries(${EXECUTABLE_NAME} # PUBLIC
"-framework AppTrackingTransparency"
"-framework Safety"
"-framework StoreKit"
)
If the skip choice is checked and must override the Xcode challenge, you may take away the construct/ios
folder or the only file construct/ios/proj/CMakeCache.txt
, to set off regenerate.
1 Like
@PatriceJiang , will the library be added after constructing in cocos creator software with the above command? .
I attempted your code nevertheless it construct failed . Are you certain the next is syntactically right ?
target_link_libraries(${EXECUTABLE_NAME} PUBLIC
"-framework AppTrackingTransparency"
"-framework Safety"
"-framework StoreKit"
)
will the library be added after constructing in cocos creator software with the above command?
Sure
Are you certain the next is syntactically right ?
What sort of error report do you meet? target_link_libraries.
Pls, strive whether or not you may appropriately embody the corresponding header file. I’m unsure whether or not your verification methodology is dependable
Attempt to take away the key phrase PUBLIC
to see in case you can remedy the error reported
1 Like
Sorry, i don’t have expertise for ios growth . i believed that I needed to test right here @PatriceJiang .
If I’ve some library recordsdata which is downloaded . Learn how to mechanically add them to challenge xcode after construct @PatriceJiang ?
You should utilize add_library
and target_link_libraries
For instance:
# import
add_library(freetype STATIC IMPORTED GLOBAL)
set_target_properties(freetype PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/libs/libfreetype.a
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/embody/freetype
)
# hyperlink
target_link_libraries(${EXECUTABLE_NAME} PUBLIC
freetype
)
[ad_2]