Skip to content

use enable_language as needed in cmake outputs? #162

Description

@DanAlbert

As an aside, it would also be useful to check inside the SDL2Config.cmake config file whether the CXX language is actually enabled.
Because if it is not, the build process will fail at a later time.
See e.g. this issue I created earlier this year.

I think the cmake config file might need something like:

include(CheckLanguage)
check_language(CXX)
if(NOT CMAKE_CXX_COMPILER)
    message(WARNING "SDL2 requires CXX, but it not enabled.")
endif()

CheckLanguage documentation

Or skip the warning and do enable_language(CXX) yourself.

Originally posted by @madebr in #161 (comment)

Activity

  1. DanAlbert commented on Oct 11, 2022

    @DanAlbert
    ContributorAuthor

    Probably fine to just use enable_language? I'd at least be content to start with that and change the behavior later if that causes issues.

  2. madebr commented on Oct 11, 2022

    @madebr

    For Android, this won't pose any problems because a c++ compiler is guaranteed to exist.

    This change will touch #134.
    OpenSSL is pure C and does not need a C++ linker.

  3. DanAlbert commented on Oct 11, 2022

    @DanAlbert
    ContributorAuthor

    It's not a missing compiler that I'm worried about, I'm curious if there are CMakeLists.txt files out there that behave differently based on whether the project enables C++ or not. If some vendored dependency pulled in via add_subdirectory builds additional libraries that aren't needed for C users, for example. It's a stretch, so probably fine to ignore until we hear about it causing a problem in the real world.

  4. added this to Prefab 2.2.0 and removed this from Prefab 2.1.0on Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions