Skip to content

Conversation

@stanhu
Copy link
Contributor

@stanhu stanhu commented Jul 9, 2024

Certain versions of clang (e.g. 15.0 on macOS) require manually enabling C++ extensions via -std=c++<version>, and ICU 75.1 needs C++17. Auto-detect the flags that are needed to build.

The default C++ version depends on the version of clang:

clang 15.0.0 (macOS Sonoma)

# echo "" | clang++ -dM -E -x c++ - | grep __cplusplus
#define __cplusplus 199711L

On clang 18.1.8 (shipped with archlinux/archlinux:base):

# echo "" | clang++ -dM -E -x c++ - | grep __cplusplus
#define __cplusplus 201703L
__cplusplus string Version
199711L C++98
201103L C++11
201402L C++14
201703L C++17
202002L C++20

Relates to #172

Closes #177

stanhu added 2 commits July 8, 2024 18:03
clang requires manually enabling C++ extensions via
`-std=c++<version>`, and ICU 75.1 needs C++17. Auto-detect the flags
that are needed to build.

Relates to brianmario#172

Closes brianmario#177
C++ compilation failed without these explicit casts.
@stanhu stanhu force-pushed the sh-auto-detect-cxx-flags branch from 1b5b275 to 7f026b4 Compare July 9, 2024 01:09
Now that a C++ compiler is used to support later versions of ICU, we
need to surround all C code with `extern "C"` to avoid name mangling
that would cause issues with symbol resolution on macOS.
@stanhu stanhu force-pushed the sh-auto-detect-cxx-flags branch from 405d3c6 to 01df9a5 Compare July 9, 2024 05:04
@tenderlove tenderlove merged commit b77c32c into brianmario:master Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installing 0.7.8 on macOS 14.5 (Sonoma) error.

2 participants