summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2020-08-22 10:04:29 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2020-08-29 10:01:10 +0200
commit95aea798dbd785c4daee2b2e24f2c8c94f3e3cf4 (patch)
tree723ee619003e49c2295ad19c4b084e416b4fdefd /CMakeLists.txt
parent05729b66c56fe67ce96a1a0a037cd4946aa46e36 (diff)
downloadcurl-95aea798dbd785c4daee2b2e24f2c8c94f3e3cf4.tar.gz
CMake: add option to enable Unicode on Windows
As already existing for winbuild. Closes https://github.com/curl/curl/pull/5843
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68842ee3e..6388015d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,7 @@ option(ENABLE_ARES "Set to ON to enable c-ares support" OFF)
if(WIN32)
option(CURL_STATIC_CRT "Set to ON to build libcurl with static CRT on Windows (/MT)." OFF)
option(ENABLE_INET_PTON "Set to OFF to prevent usage of inet_pton when building against modern SDKs while still requiring compatibility with older Windows versions, such as Windows XP, Windows Server 2003 etc." ON)
+ option(ENABLE_UNICODE "Set to ON to use the Unicode version of the Windows API functions" OFF)
set(CURL_TARGET_WINDOWS_VERSION "" CACHE STRING "Minimum target Windows version as hex string")
if(CURL_TARGET_WINDOWS_VERSION)
add_definitions(-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION})
@@ -92,6 +93,12 @@ if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0501)
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=0x0501")
endif()
+ if(ENABLE_UNICODE)
+ add_definitions(-DUNICODE -D_UNICODE)
+ if(MINGW)
+ add_compile_options(-municode)
+ endif()
+ endif()
endif()
option(CURL_LTO "Turn on compiler Link Time Optimizations" OFF)