Skip to content

Versioning: Conditionally including entire files #246

@MonsterDruide1

Description

@MonsterDruide1

Follow-up discussion to #162.

So far, we can use #if FEATURE_FLAG to conditionally include functions/tokens/..., but this is not enough.

Between different versions, new files were introduced or old files were deleted as well. Currently however, all of them are included with add_library(...) in CMakeLists.txt without further conditions.

How should we handle adding/removing entire files depending on the version?

Suggestion A: #ifdef the entire file.

Suggestion B:
Move add_compile_definitions(SEAD_VERSION=CMAKE_SEAD_VERSION) from the application into sead's CMakeLists.txt, with CMAKE_SEAD_VERSION being a CMake variable (=> set(CMAKE_SEAD_VERSION "SMO") in application). Then, conditionally include files using CMake conditions (if(CMAKE_SEAD_VERSION STREQUAL "SMO")).

Suggestion C:
Combine B with removing the entire seadVersion.h, and handle everything in a separate CMakeLists.txt-file, which adds more compile definitions depending on the selected version.

Suggestion D?
Please suggest other things if you have a different idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions