Skip to content

CHECK_CXX_SOURCE_COMPILES ignores compiler flags on macOS #639

@tkemmer

Description

@tkemmer

On macOS, the configuration script ignores additional compiler flags when performing C++ compilation checks, caused explicitly by:

IF(NOT APPLE)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${BALL_PROJECT_COMPILE_FLAGS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${BALL_PROJECT_COMPILE_DEFNS}")
ENDIF()

This behavior results in some C++11 language features being disabled on macOS although being supported. Currently affected feature guards:

  • BALL_HAS_THREAD_LOCAL
  • BALL_HAS_NOEXCEPT
  • BALL_HAS_STD_STRING_CONST_ITERATOR_INITLIST_INSERT

Removing the condition from the code above solves this problem. However, this causes the FindXDR CMake macro to fail, disabling persistence support as a consequence.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions