diff options
author | Victor Zverovich <victor.zverovich@gmail.com> | 2019-06-23 17:10:57 -0700 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2019-06-23 17:10:57 -0700 |
commit | d5d58656150e58b9fcebbaeed81f6c00c983f883 (patch) | |
tree | 93baf4e5950194721e68929634439a8920f97ff3 /CMakeLists.txt | |
parent | 29ef7d31e4f475c3c33e3c8cf601d04a772a8897 (diff) | |
download | fmtlib-d5d58656150e58b9fcebbaeed81f6c00c983f883.tar.gz |
Move strtod_l check to CMake since it's very system-specific
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ed14463..6214d5a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,11 +127,18 @@ if (MASTER_PROJECT AND CMAKE_GENERATOR MATCHES "Visual Studio") ${CMAKE_MAKE_PROGRAM} -p:FrameworkPathOverride=\"${netfxpath}\" %*") endif () +set(strtod_l_headers stdlib.h) +if (APPLE) + set(strtod_l_headers ${strtod_l_headers} xlocale.h) +endif () + include(CheckSymbolExists) if (WIN32) check_symbol_exists(open io.h HAVE_OPEN) + check_symbol_exists(_strtod_l "${strtod_l_headers}" HAVE_STRTOD_L) else () check_symbol_exists(open fcntl.h HAVE_OPEN) + check_symbol_exists(strtod_l "${strtod_l_headers}" HAVE_STRTOD_L) endif () function(add_headers VAR) @@ -154,6 +161,10 @@ endif () add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS} README.rst ChangeLog.rst) add_library(fmt::fmt ALIAS fmt) +if (HAVE_STRTOD_L) + target_compile_definitions(fmt PUBLIC FMT_LOCALE) +endif () + if (FMT_WERROR) target_compile_options(fmt PRIVATE ${WERROR_FLAG}) endif () |