-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Check for locale support in CMake #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for locale support in CMake #551
Conversation
check_type_size(lconv LCONV_SIZE LANGUAGE CXX) | ||
set(CMAKE_EXTRA_INCLUDE_FILES "") | ||
check_struct_has_member(lconv decimal_point clocale HAVE_DECIMAL_POINT LANGUAGE CXX) | ||
check_cxx_symbol_exists(localeconv clocale HAVE_LOCALECONV) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frustrating how inconsistent the CMake API is with regards to setting language and adding headers.
I see both gcc and clang in travis fail |
I nailed it down to a change in CMake 3.0 where they added the I see some options, but not sure which is best:
|
I implemented the second option as it seems to be the least problematic. Now, I misread the build log. It wasn't only |
67685ed
to
3559236
Compare
I amended my previous commit with a proper fix for the problem. It's not pretty, but it's the best I could do if we want to support older CMake versions. |
Could you include that amendment in this PR? Don't worry too much about build-breakage. But if you fallback to |
3559236
to
5a82131
Compare
I squashed my two first commits, and added a commit for |
This should improve #527 by checking for locale support at configure time.
Example output from our Android build with this change:
I would also like to suggest changing
NO_LOCALE_SUPPORT
toJSONCPP_NO_LOCALE_SUPPORT
as to not clutter the global namespace. But this would break builds relying onNO_LOCALE_SUPPORT
, so I didn't implement it.