build: use std:: proxy for nonstd:: on non-macOS

The nonstd:: implementation of nonstd::variant was causing a link error
in the Debug configuration on MSYS2 CLANG64.

Set the macros for choosing the implementation of both nonstd::optional
and nonstd::variant to the std:: forwarding behavior on all platforms
other than macOS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2023-10-24 17:22:47 +00:00
parent 1c76e3b0f4
commit e19e13fa0a
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 7 additions and 2 deletions

View File

@ -491,8 +491,13 @@ add_definitions(-D__STDC_FORMAT_MACROS)
# For C++, default to nonstd::optional and nonstd::variant for now due to mac # For C++, default to nonstd::optional and nonstd::variant for now due to mac
# build issues. # build issues.
add_definitions(-Doptional_CONFIG_SELECT_OPTIONAL=optional_OPTIONAL_NONSTD) if(APPLE)
add_definitions(-Dvariant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD) add_definitions(-Doptional_CONFIG_SELECT_OPTIONAL=optional_OPTIONAL_NONSTD)
add_definitions(-Dvariant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD)
else()
add_definitions(-Doptional_CONFIG_SELECT_OPTIONAL=optional_OPTIONAL_STD)
add_definitions(-Dvariant_CONFIG_SELECT_VARIANT=variant_VARIANT_STD)
endif()
if(ENABLE_LINK) if(ENABLE_LINK)
# IPC linking code needs sem_timedwait which can be either in librt or pthreads # IPC linking code needs sem_timedwait which can be either in librt or pthreads