axmol icon indicating copy to clipboard operation
axmol copied to clipboard

Project source code folder structure adjustment

Open smilediver opened this issue 2 years ago • 3 comments

Right now all project files are inside core folder and the engine adds a lot of unnecessary include paths to the project, which makes the setup brittle to header conflicts. I'm proposing to move all files inside core to core/axmol. This would allow to add core path for includes and use #include <axmol/2d/Node.h>, instead of something like #include <axmol/core/2d/Node.h> or raw #include <2d/Node.h> which is too basic and is exposed to conflicts with headers from the project or other external libraries.

And this setup:

target_include_directories(${_AX_CORE_LIB}
    PUBLIC ${_AX_ROOT}
    PUBLIC ${_AX_ROOT}/thirdparty
    PUBLIC ${_AX_ROOT}/extensions
    PUBLIC ${_AX_ROOT}/core
    PUBLIC ${_AX_ROOT}/core/platform

    INTERFACE ${_AX_ROOT}/thirdparty
    INTERFACE ${_AX_ROOT}/extensions
    INTERFACE ${_AX_ROOT}/core/base
    INTERFACE ${_AX_ROOT}/core/audio
    INTERFACE ${_AX_ROOT}/core/platform/${PLATFORM_NAME}
)

should be reduced to something like this:

target_include_directories(${_AX_CORE_LIB}
    PUBLIC ${_AX_ROOT}/core
    PUBLIC ${_AX_ROOT}/thirdparty
)

smilediver avatar Feb 01 '24 17:02 smilediver

While this is a good idea, it is a breaking change, so perhaps it would be best to leave it for the v2.2 release?

rh101 avatar Feb 02 '24 07:02 rh101

While this is a good idea, it is a breaking change, so perhaps it would be best to leave it for the v2.2 release?

Yes

halx99 avatar Feb 02 '24 15:02 halx99

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 09 '24 21:04 stale[bot]