build: correctly set MSVC __cplusplus (#8120)

* build: correctly set MSVC `__cplusplus`

* refactor: let utf8cpp infer `UTF_CPP_CPLUSPLUS`
This commit is contained in:
Yat Ho
2026-01-14 05:02:50 +08:00
committed by GitHub
parent 8dea0e863f
commit 4f7b932fee
2 changed files with 2 additions and 1 deletions

View File

@@ -223,6 +223,8 @@ if(WIN32)
set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /utf-8")
# Reduce noise (at least for now)
set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /wd4244 /wd4267")
# Correctly set __cplusplus macro value
set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} /Zc:__cplusplus")
# Make caching-friendly (store debug info inside object files)
foreach(T IN ITEMS ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
string(TOUPPER "${T}" T)

View File

@@ -36,7 +36,6 @@
#include <sys/stat.h> /* umask() */
#endif
#define UTF_CPP_CPLUSPLUS 201703L
#include <utf8.h>
#include <curl/curl.h>