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
868 stars 195 forks source link

Do not copy Resources folder for linux and windows - create sym links #1005

Closed crazyhappygame closed 1 year ago

crazyhappygame commented 1 year ago

Is your feature request related to a problem? Please describe. Coping file is slow and inefficient

Describe the solution you'd like Use links

Describe alternatives you've considered N/A

Additional context N/A

possible solution:

if(LINUX OR WINDOWS)
    add_custom_command(
        TARGET ${APP_NAME}
        PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
        create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/Resources $<TARGET_FILE_DIR:${APP_NAME}>/Resources)
endif()
rh101 commented 1 year ago

This was great when building for Cocos2d-x, but it may not be necessary for Axmol (Windows builds), since the Resource folder is no longer copied to the output folder. I'm not sure about Linux though, since I don't build on that platform, so I'm not sure how resources are handled on there.

aismann commented 1 year ago

You can create a symbolic link like below (works for windows) As example: cpp-test: open command shell (with admin privileges): mklink /D Resources ..\..\..\..\tests\cpp-tests\Resources

cd axmol\build_64\bin\cpp_tests\Debug
axmol\build_64\bin\cpp_tests\Debug>mklink /D Resources  ..\..\..\..\tests\cpp-tests\Resources

Now you can run the exe (e.g. cpp_tests.exe) from Debug folder every time.