Unverified Commit 020a9ce1 authored by Mark Lindner's avatar Mark Lindner Committed by GitHub

Merge pull request #213 from thomastrapp/master

Fix locale handling when building with cmake
parents 98a52a4d b3a1aedf
......@@ -58,10 +58,6 @@ set_target_properties(${libname}++
VERSION "${libconfig_VERSION}"
PUBLIC_HEADER "${libinc_cpp}")
#check_symbol_exists(uselocale "locale.h" HAVE_USELOCALE)
#check_symbol_exists(newlocale "locale.h" HAVE_NEWLOCALE)
#check_symbol_exists(freelocale "locale.h" HAVE_FREELOCALE)
if(BUILD_SHARED_LIBS)
target_compile_definitions(${libname}++ PRIVATE LIBCONFIG_STATIC)
else()
......@@ -69,19 +65,35 @@ else()
target_compile_definitions(${libname}++ PUBLIC LIBCONFIGXX_STATIC)
endif()
if(APPLE)
check_symbol_exists(uselocale "xlocale.h" HAVE_USELOCALE)
check_symbol_exists(newlocale "xlocale.h" HAVE_NEWLOCALE)
check_symbol_exists(freelocale "xlocale.h" HAVE_FREELOCALE)
else()
check_symbol_exists(uselocale "locale.h" HAVE_USELOCALE)
check_symbol_exists(newlocale "locale.h" HAVE_NEWLOCALE)
check_symbol_exists(freelocale "locale.h" HAVE_FREELOCALE)
endif()
if(HAVE_USELOCALE)
target_compile_definitions(${libname}
PRIVATE "HAVE_USELOCALE")
target_compile_definitions(${libname}
PRIVATE "HAVE_USELOCALE")
target_compile_definitions(${libname}++
PRIVATE "HAVE_USELOCALE")
endif()
if(HAVE_NEWLOCALE)
target_compile_definitions(${libname}
PRIVATE "HAVE_NEWLOCALE")
target_compile_definitions(${libname}
PRIVATE "HAVE_NEWLOCALE")
target_compile_definitions(${libname}++
PRIVATE "HAVE_NEWLOCALE")
endif()
if(HAVE_FREELOCALE)
target_compile_definitions(${libname}
PRIVATE "HAVE_FREELOCALE")
target_compile_definitions(${libname}
PRIVATE "HAVE_FREELOCALE")
target_compile_definitions(${libname}++
PRIVATE "HAVE_FREELOCALE")
endif()
if(MSVC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment