From 6ba60ac11b9a716ad7f9e0c0db872bbe09f1cedd Mon Sep 17 00:00:00 2001 From: alesapin Date: Tue, 1 Oct 2024 21:27:41 +0200 Subject: [PATCH] New era --- CMakeLists.txt | 2 +- contrib/icu-cmake/CMakeLists.txt | 5 +- contrib/poco/Crypto/CMakeLists.txt | 41 +++---- contrib/poco/Data/CMakeLists.txt | 28 ++--- contrib/poco/Data/ODBC/CMakeLists.txt | 31 +++--- contrib/poco/Data/ODBC/src/Extractor.cpp | 8 +- contrib/poco/Foundation/CMakeLists.txt | 101 +++++++++--------- .../poco/Foundation/src/EventLogChannel.cpp | 19 ++-- contrib/poco/JSON/CMakeLists.txt | 41 +++---- contrib/poco/Net/CMakeLists.txt | 52 ++++----- contrib/poco/NetSSL_Win/CMakeLists.txt | 3 + contrib/poco/Util/CMakeLists.txt | 28 ++--- contrib/poco/XML/CMakeLists.txt | 65 +++++------ contrib/zlib-ng-cmake/CMakeLists.txt | 6 +- driver/CMakeLists.txt | 4 + driver/api/odbc.cpp | 4 +- 16 files changed, 231 insertions(+), 207 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e2fff28d..5b9c190f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ option (CH_ODBC_ALLOW_UNSAFE_DISPATCH "Allow unchecked handle dispatching (may s option (CH_ODBC_ENABLE_SSL "Enable SSL (required for utilizing https:// interface, etc.)" ON) option (CH_ODBC_ENABLE_INSTALL "Enable install targets (required for packaging)" ON) cmake_dependent_option (CH_ODBC_ENABLE_TESTING "Enable test targets" ON "BUILD_TESTING" OFF) -option (CH_ODBC_USE_ICU "Use ICU library, instead of C++ STD, for Unicode conversions" ON) +cmake_dependent_option (CH_ODBC_USE_ICU "Use ICU library, instead of C++ STD, for Unicode conversions" ON "NOT MSVC" OFF) option (CH_ODBC_PREFER_BUNDLED_THIRD_PARTIES "Prefer bundled over system variants of third party libraries" ON) cmake_dependent_option (CH_ODBC_PREFER_BUNDLED_POCO "Prefer bundled over system variants of Poco library" ON "CH_ODBC_PREFER_BUNDLED_THIRD_PARTIES" OFF) cmake_dependent_option (CH_ODBC_PREFER_BUNDLED_SSL "Prefer bundled over system variants of SSL library" ON "CH_ODBC_PREFER_BUNDLED_POCO" OFF) diff --git a/contrib/icu-cmake/CMakeLists.txt b/contrib/icu-cmake/CMakeLists.txt index e3780c5d1..db54a2c66 100644 --- a/contrib/icu-cmake/CMakeLists.txt +++ b/contrib/icu-cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -if (OS_LINUX OR OS_DARWIN OR OS_WINDOWS) +if (OS_LINUX OR OS_DARWIN) option(ENABLE_ICU "Enable ICU" 1) else () option(ENABLE_ICU "Enable ICU" 0) @@ -462,7 +462,7 @@ enable_language(ASM) if (ARCH_S390X) set(ICUDATA_SOURCE_FILE "${ICUDATA_SOURCE_DIR}/icudt75b_dat.S" ) else() - if (OS_LINUX) + if (OS_LINUX OR OS_WINDOWS) set(ICUDATA_SOURCE_FILE "${ICUDATA_SOURCE_DIR}/icudt75l_dat.S" ) elseif (OS_DARWIN) if (ARCH_AARCH64) @@ -483,7 +483,6 @@ if (OS_LINUX OR OS_DARWIN) add_definitions(-D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=0 -DDEFAULT_ICU_PLUGINS="/dev/null") elseif (OS_WINDOWS) add_definitions(-D_REENTRANT -DDEFAULT_ICU_PLUGINS="/dev/null") - endif() add_library(_icuuc ${ICUUC_SOURCES}) diff --git a/contrib/poco/Crypto/CMakeLists.txt b/contrib/poco/Crypto/CMakeLists.txt index 67171afad..0c3cb895a 100644 --- a/contrib/poco/Crypto/CMakeLists.txt +++ b/contrib/poco/Crypto/CMakeLists.txt @@ -3,26 +3,27 @@ if (ENABLE_SSL) add_library (_poco_crypto ${SRCS}) add_library (Poco::Crypto ALIAS _poco_crypto) - - # TODO: remove these warning exclusions - target_compile_options (_poco_crypto - PRIVATE - -Wno-covered-switch-default - -Wno-deprecated-dynamic-exception-spec - -Wno-extra-semi-stmt - -Wno-missing-noreturn - -Wno-newline-eof - -Wno-old-style-cast - -Wno-shadow - -Wno-shorten-64-to-32 - -Wno-sign-compare - -Wno-suggest-destructor-override - -Wno-suggest-override - -Wno-unreachable-code-return - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant - -Wno-used-but-marked-unused - ) + if (NOT MSVC) + # TODO: remove these warning exclusions + target_compile_options (_poco_crypto + PRIVATE + -Wno-covered-switch-default + -Wno-deprecated-dynamic-exception-spec + -Wno-extra-semi-stmt + -Wno-missing-noreturn + -Wno-newline-eof + -Wno-old-style-cast + -Wno-shadow + -Wno-shorten-64-to-32 + -Wno-sign-compare + -Wno-suggest-destructor-override + -Wno-suggest-override + -Wno-unreachable-code-return + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + -Wno-used-but-marked-unused + ) + endif() target_include_directories (_poco_crypto SYSTEM PUBLIC "include") target_link_libraries (_poco_crypto PUBLIC Poco::Foundation OpenSSL::SSL OpenSSL::Crypto) diff --git a/contrib/poco/Data/CMakeLists.txt b/contrib/poco/Data/CMakeLists.txt index dfdf3194f..b2de7f3b6 100644 --- a/contrib/poco/Data/CMakeLists.txt +++ b/contrib/poco/Data/CMakeLists.txt @@ -3,18 +3,20 @@ file (GLOB SRCS src/*.cpp) add_library (_poco_data ${SRCS}) add_library (Poco::Data ALIAS _poco_data) -# TODO: remove these warning exclusions -target_compile_options (_poco_data - PRIVATE - -Wno-comma - -Wno-covered-switch-default - -Wno-deprecated-dynamic-exception-spec - -Wno-extra-semi-stmt - -Wno-old-style-cast - -Wno-shorten-64-to-32 - -Wno-sign-compare - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant -) +if (NOT MSVC) + # TODO: remove these warning exclusions + target_compile_options (_poco_data + PRIVATE + -Wno-comma + -Wno-covered-switch-default + -Wno-deprecated-dynamic-exception-spec + -Wno-extra-semi-stmt + -Wno-old-style-cast + -Wno-shorten-64-to-32 + -Wno-sign-compare + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + ) +endif() target_include_directories (_poco_data SYSTEM PUBLIC "include") target_link_libraries (_poco_data PUBLIC Poco::Foundation) diff --git a/contrib/poco/Data/ODBC/CMakeLists.txt b/contrib/poco/Data/ODBC/CMakeLists.txt index 1b6faafe5..158e3f726 100644 --- a/contrib/poco/Data/ODBC/CMakeLists.txt +++ b/contrib/poco/Data/ODBC/CMakeLists.txt @@ -22,21 +22,22 @@ if (ENABLE_ODBC) add_library (_poco_data_odbc ${SRCS}) add_library (Poco::Data::ODBC ALIAS _poco_data_odbc) - - # TODO: remove these warning exclusions - target_compile_options (_poco_data_odbc - PRIVATE - -Wno-cast-qual - -Wno-deprecated-dynamic-exception-spec - -Wno-extra-semi-stmt - -Wno-old-style-cast - -Wno-sign-compare - -Wno-tautological-constant-out-of-range-compare - -Wno-tautological-unsigned-zero-compare - -Wno-unused-parameter - -Wno-unused-variable - -Wno-zero-as-null-pointer-constant - ) + if (NOT MSVC) + # TODO: remove these warning exclusions + target_compile_options (_poco_data_odbc + PRIVATE + -Wno-cast-qual + -Wno-deprecated-dynamic-exception-spec + -Wno-extra-semi-stmt + -Wno-old-style-cast + -Wno-sign-compare + -Wno-tautological-constant-out-of-range-compare + -Wno-tautological-unsigned-zero-compare + -Wno-unused-parameter + -Wno-unused-variable + -Wno-zero-as-null-pointer-constant + ) + endif() target_include_directories (_poco_data_odbc SYSTEM PUBLIC "include") if (OS_LINUX OR OS_DARWIN) target_link_libraries (_poco_data_odbc PUBLIC Poco::Data ch_contrib::unixodbc) diff --git a/contrib/poco/Data/ODBC/src/Extractor.cpp b/contrib/poco/Data/ODBC/src/Extractor.cpp index 0961fa2b5..ba3c2634a 100644 --- a/contrib/poco/Data/ODBC/src/Extractor.cpp +++ b/contrib/poco/Data/ODBC/src/Extractor.cpp @@ -287,7 +287,7 @@ bool Extractor::extractManualImpl(std::size_t pos, std::string& val if (totalSize <= maxSize) val.append(pChar, fetchedSize); else - throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); + throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); }while (true); return true; @@ -342,7 +342,7 @@ bool Extractor::extractManualImpl(std::size_t pos, UTF16String& val if (totalSize <= maxSize) val.append(pChar, fetchedSize / sizeof(UTF16Char)); else - throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); + throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); } while (true); return true; @@ -397,7 +397,7 @@ bool Extractor::extractManualImpl(std::size_t pos, if (totalSize <= maxSize) val.appendRaw(pChar, fetchedSize); else - throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); + throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); }while (true); @@ -1305,7 +1305,7 @@ void Extractor::checkDataSize(std::size_t size) { std::size_t maxSize = _pPreparator->getMaxFieldSize(); if (size > maxSize) - throw DataException(format(FLD_SIZE_EXCEEDED_FMT, size, maxSize)); + throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, size, maxSize)); } diff --git a/contrib/poco/Foundation/CMakeLists.txt b/contrib/poco/Foundation/CMakeLists.txt index 5e7b58e39..a6f3fdb01 100644 --- a/contrib/poco/Foundation/CMakeLists.txt +++ b/contrib/poco/Foundation/CMakeLists.txt @@ -4,20 +4,23 @@ add_library (_poco_foundation_pcre ${SRCS_PCRE}) add_library (Poco::Foundation::PCRE ALIAS _poco_foundation_pcre) # TODO: remove these warning exclusions -target_compile_options (_poco_foundation_pcre - PRIVATE - -Wno-cast-align - -Wno-cast-qual - -Wno-comma - -Wno-conditional-uninitialized - -Wno-extra-semi-stmt - -Wno-implicit-fallthrough - -Wno-reserved-identifier - -Wno-sign-compare - -Wno-unknown-pragmas - -Wno-unreachable-code-break - -Wno-unused-macros -) +if (NOT MSVC) + target_compile_options (_poco_foundation_pcre + PRIVATE + -Wno-cast-align + -Wno-cast-qual + -Wno-comma + -Wno-conditional-uninitialized + -Wno-extra-semi-stmt + -Wno-implicit-fallthrough + -Wno-reserved-identifier + -Wno-sign-compare + -Wno-unknown-pragmas + -Wno-unreachable-code-break + -Wno-unused-macros + ) +endif() + set(SRCS src/ASCIIEncoding.cpp src/AbstractObserver.cpp @@ -64,7 +67,7 @@ src/ErrorHandler.cpp src/Event.cpp src/EventArgs.cpp src/EventChannel.cpp -#src/EventLogChannel.cpp +src/EventLogChannel.cpp #src/Event_POSIX.cpp #src/Event_VX.cpp #src/Event_WIN32.cpp @@ -271,39 +274,41 @@ elseif(OS_WINDOWS) target_compile_definitions (_poco_foundation PUBLIC POCO_OS_FAMILY_WINDOWS Foundation_EXPORTS) endif() -target_compile_options (_poco_foundation - PRIVATE - -Wno-array-bounds - -Wno-atomic-implicit-seq-cst - -Wno-cast-align - -Wno-cast-qual - -Wno-class-varargs - -Wno-covered-switch-default - -Wno-deprecated - -Wno-extra-semi-stmt - -Wno-implicit-fallthrough - -Wno-implicit-int-float-conversion - -Wno-misleading-indentation - -Wno-missing-noreturn - -Wno-old-style-cast - -Wno-redundant-parens - -Wno-reserved-identifier - -Wno-reserved-macro-identifier - -Wno-shadow - -Wno-shorten-64-to-32 - -Wno-sign-compare - -Wno-suggest-destructor-override - -Wno-suggest-override - -Wno-tautological-unsigned-zero-compare - -Wno-thread-safety-analysis - -Wno-thread-safety-negative - -Wno-undef - -Wno-unreachable-code-return - -Wno-unused-exception-parameter - -Wno-unused-macros - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant -) +if (NOT MSVC) + target_compile_options (_poco_foundation + PRIVATE + -Wno-array-bounds + -Wno-atomic-implicit-seq-cst + -Wno-cast-align + -Wno-cast-qual + -Wno-class-varargs + -Wno-covered-switch-default + -Wno-deprecated + -Wno-extra-semi-stmt + -Wno-implicit-fallthrough + -Wno-implicit-int-float-conversion + -Wno-misleading-indentation + -Wno-missing-noreturn + -Wno-old-style-cast + -Wno-redundant-parens + -Wno-reserved-identifier + -Wno-reserved-macro-identifier + -Wno-shadow + -Wno-shorten-64-to-32 + -Wno-sign-compare + -Wno-suggest-destructor-override + -Wno-suggest-override + -Wno-tautological-unsigned-zero-compare + -Wno-thread-safety-analysis + -Wno-thread-safety-negative + -Wno-undef + -Wno-unreachable-code-return + -Wno-unused-exception-parameter + -Wno-unused-macros + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + ) +endif() add_definitions( -DPCRE_STATIC) diff --git a/contrib/poco/Foundation/src/EventLogChannel.cpp b/contrib/poco/Foundation/src/EventLogChannel.cpp index ed4e25a6d..de6f8a9bc 100644 --- a/contrib/poco/Foundation/src/EventLogChannel.cpp +++ b/contrib/poco/Foundation/src/EventLogChannel.cpp @@ -15,7 +15,6 @@ #include "Poco/EventLogChannel.h" #include "Poco/Message.h" #include "Poco/String.h" -#include "pocomsg.h" #if defined(POCO_WIN32_UTF8) #include "Poco/UnicodeConverter.h" #endif @@ -120,7 +119,7 @@ void EventLogChannel::log(const Message& msg) std::wstring utext; UnicodeConverter::toUTF16(msg.getText(), utext); const wchar_t* pMsg = utext.c_str(); - ReportEventW(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL); + ReportEventW(_h, getType(msg), getCategory(msg), 0x1000, NULL, 1, 0, &pMsg, NULL); #else const char* pMsg = msg.getText().c_str(); ReportEvent(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL); @@ -180,21 +179,21 @@ int EventLogChannel::getCategory(const Message& msg) switch (msg.getPriority()) { case Message::PRIO_TRACE: - return POCO_CTG_TRACE; + return 0x8; case Message::PRIO_DEBUG: - return POCO_CTG_DEBUG; + return 0x7; case Message::PRIO_INFORMATION: - return POCO_CTG_INFORMATION; + return 0x6; case Message::PRIO_NOTICE: - return POCO_CTG_NOTICE; + return 0x5; case Message::PRIO_WARNING: - return POCO_CTG_WARNING; + return 0x4; case Message::PRIO_ERROR: - return POCO_CTG_ERROR; + return 0x3; case Message::PRIO_CRITICAL: - return POCO_CTG_CRITICAL; + return 0x2; case Message::PRIO_FATAL: - return POCO_CTG_FATAL; + return 0x1; default: return 0; } diff --git a/contrib/poco/JSON/CMakeLists.txt b/contrib/poco/JSON/CMakeLists.txt index 482399cba..a1dc52024 100644 --- a/contrib/poco/JSON/CMakeLists.txt +++ b/contrib/poco/JSON/CMakeLists.txt @@ -8,16 +8,17 @@ add_library (_poco_json_pdjson ${SRCS_PDJSON}) add_library (Poco::JSON::Pdjson ALIAS _poco_json_pdjson) # TODO: remove these warning exclusions -target_compile_options (_poco_json_pdjson - PRIVATE - -Wno-cast-qual - -Wno-declaration-after-statement - -Wno-extra-semi-stmt - -Wno-implicit-fallthrough - -Wno-shorten-64-to-32 - -Wno-unreachable-code-return -) - +if (NOT MSVC) + target_compile_options (_poco_json_pdjson + PRIVATE + -Wno-cast-qual + -Wno-declaration-after-statement + -Wno-extra-semi-stmt + -Wno-implicit-fallthrough + -Wno-shorten-64-to-32 + -Wno-unreachable-code-return + ) +endif() # Poco::JSON file (GLOB SRCS src/*.cpp) @@ -26,15 +27,17 @@ add_library (_poco_json ${SRCS}) add_library (Poco::JSON ALIAS _poco_json) # TODO: remove these warning exclusions -target_compile_options (_poco_json - PRIVATE - -Wno-deprecated-dynamic-exception-spec - -Wno-sign-compare - -Wno-suggest-destructor-override - -Wno-suggest-override - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant -) +if (NOT MSVC) + target_compile_options (_poco_json + PRIVATE + -Wno-deprecated-dynamic-exception-spec + -Wno-sign-compare + -Wno-suggest-destructor-override + -Wno-suggest-override + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + ) +endif() target_include_directories (_poco_json SYSTEM PUBLIC "include") target_link_libraries (_poco_json PUBLIC Poco::Foundation Poco::JSON::Pdjson) diff --git a/contrib/poco/Net/CMakeLists.txt b/contrib/poco/Net/CMakeLists.txt index de58b8d77..87e15a708 100644 --- a/contrib/poco/Net/CMakeLists.txt +++ b/contrib/poco/Net/CMakeLists.txt @@ -22,31 +22,33 @@ if (OS_SUNOS) target_link_libraries (_poco_net PUBLIC socket nsl) endif () -# TODO: remove these warning exclusions -target_compile_options (_poco_net - PRIVATE - -Wno-atomic-implicit-seq-cst - -Wno-cast-align - -Wno-cast-qual - -Wno-comma - -Wno-covered-switch-default - -Wno-deprecated - -Wno-extra-semi - -Wno-extra-semi-stmt - -Wno-missing-noreturn - -Wno-old-style-cast - -Wno-shadow - -Wno-shorten-64-to-32 - -Wno-sign-compare - -Wno-suggest-destructor-override - -Wno-suggest-override - -Wno-undef - -Wno-unreachable-code - -Wno-unreachable-code-return - -Wno-unused-macros - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant -) +if (NOT MSVC) + # TODO: remove these warning exclusions + target_compile_options (_poco_net + PRIVATE + -Wno-atomic-implicit-seq-cst + -Wno-cast-align + -Wno-cast-qual + -Wno-comma + -Wno-covered-switch-default + -Wno-deprecated + -Wno-extra-semi + -Wno-extra-semi-stmt + -Wno-missing-noreturn + -Wno-old-style-cast + -Wno-shadow + -Wno-shorten-64-to-32 + -Wno-sign-compare + -Wno-suggest-destructor-override + -Wno-suggest-override + -Wno-undef + -Wno-unreachable-code + -Wno-unreachable-code-return + -Wno-unused-macros + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + ) +endif() target_include_directories (_poco_net SYSTEM PUBLIC "include") target_link_libraries (_poco_net PUBLIC Poco::Foundation ${SYSLIBS}) diff --git a/contrib/poco/NetSSL_Win/CMakeLists.txt b/contrib/poco/NetSSL_Win/CMakeLists.txt index ace098677..2a2bf1ba7 100644 --- a/contrib/poco/NetSSL_Win/CMakeLists.txt +++ b/contrib/poco/NetSSL_Win/CMakeLists.txt @@ -16,5 +16,8 @@ target_include_directories(_poco_net_win_ssl if (OS_DARWIN OR OS_LINUX) target_compile_definitions (_poco_net_win_ssl PUBLIC POCO_OS_FAMILY_UNIX) elseif(OS_WINDOWS) + if (MSVC) + target_compile_options(_poco_net_win_ssl PRIVATE "/Zc:strictStrings-") + endif() target_compile_definitions (_poco_net_win_ssl PUBLIC POCO_OS_FAMILY_WINDOWS NetSSL_Win_EXPORTS) endif() diff --git a/contrib/poco/Util/CMakeLists.txt b/contrib/poco/Util/CMakeLists.txt index 4dfc793d0..11c82a69e 100644 --- a/contrib/poco/Util/CMakeLists.txt +++ b/contrib/poco/Util/CMakeLists.txt @@ -3,20 +3,22 @@ file (GLOB SRCS src/*.cpp) add_library (_poco_util ${SRCS}) add_library (Poco::Util ALIAS _poco_util) +if (NOT MSVC) # TODO: remove these warning exclusions -target_compile_options (_poco_util - PRIVATE - -Wno-deprecated-dynamic-exception-spec - -Wno-extra-semi-stmt - -Wno-newline-eof - -Wno-old-style-cast - -Wno-shadow - -Wno-sign-compare - -Wno-suggest-destructor-override - -Wno-suggest-override - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant -) + target_compile_options (_poco_util + PRIVATE + -Wno-deprecated-dynamic-exception-spec + -Wno-extra-semi-stmt + -Wno-newline-eof + -Wno-old-style-cast + -Wno-shadow + -Wno-sign-compare + -Wno-suggest-destructor-override + -Wno-suggest-override + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + ) +endif() target_compile_definitions(_poco_util PRIVATE POCO_UTIL_NO_XMLCONFIGURATION) target_include_directories (_poco_util SYSTEM PUBLIC "include") target_link_libraries (_poco_util PUBLIC Poco::JSON) diff --git a/contrib/poco/XML/CMakeLists.txt b/contrib/poco/XML/CMakeLists.txt index b0c3a8631..d034a02b2 100644 --- a/contrib/poco/XML/CMakeLists.txt +++ b/contrib/poco/XML/CMakeLists.txt @@ -5,17 +5,18 @@ file (GLOB SRCS_EXPAT src/xml*.c) add_library (_poco_xml_expat ${SRCS_EXPAT}) add_library (Poco::XML::Expat ALIAS _poco_xml_expat) -# TODO: remove these warning exclusions -target_compile_options (_poco_xml_expat - PRIVATE - -Wno-cast-qual - -Wno-empty-translation-unit - -Wno-extra-semi-stmt - -Wno-implicit-fallthrough - -Wno-reserved-identifier - -Wno-unused-macros -) - +if (NOT MSVC) + # TODO: remove these warning exclusions + target_compile_options (_poco_xml_expat + PRIVATE + -Wno-cast-qual + -Wno-empty-translation-unit + -Wno-extra-semi-stmt + -Wno-implicit-fallthrough + -Wno-reserved-identifier + -Wno-unused-macros + ) +endif() target_include_directories (_poco_xml_expat PUBLIC "include") target_include_directories (_poco_xml_expat PRIVATE "../Foundation/include") @@ -25,26 +26,28 @@ file (GLOB SRCS src/*.cpp) add_library (_poco_xml ${SRCS}) add_library (Poco::XML ALIAS _poco_xml) -# TODO: remove these warning exclusions -target_compile_options (_poco_xml - PRIVATE - -Wno-cast-qual - -Wno-deprecated-dynamic-exception-spec - -Wno-implicit-fallthrough - -Wno-missing-noreturn - -Wno-old-style-cast - -Wno-reserved-identifier - -Wno-shadow - -Wno-shorten-64-to-32 - -Wno-suggest-destructor-override - -Wno-suggest-override - -Wno-tautological-type-limit-compare - -Wno-tautological-unsigned-zero-compare - -Wno-unreachable-code - -Wno-unused-macros - -Wno-unused-parameter - -Wno-zero-as-null-pointer-constant -) +if (NOT MSVC) + # TODO: remove these warning exclusions + target_compile_options (_poco_xml + PRIVATE + -Wno-cast-qual + -Wno-deprecated-dynamic-exception-spec + -Wno-implicit-fallthrough + -Wno-missing-noreturn + -Wno-old-style-cast + -Wno-reserved-identifier + -Wno-shadow + -Wno-shorten-64-to-32 + -Wno-suggest-destructor-override + -Wno-suggest-override + -Wno-tautological-type-limit-compare + -Wno-tautological-unsigned-zero-compare + -Wno-unreachable-code + -Wno-unused-macros + -Wno-unused-parameter + -Wno-zero-as-null-pointer-constant + ) +endif() target_include_directories (_poco_xml SYSTEM PUBLIC "include") target_link_libraries (_poco_xml PUBLIC Poco::Foundation Poco::XML::Expat) if (OS_DARWIN OR OS_LINUX) diff --git a/contrib/zlib-ng-cmake/CMakeLists.txt b/contrib/zlib-ng-cmake/CMakeLists.txt index 80545a82f..87f0b04d5 100644 --- a/contrib/zlib-ng-cmake/CMakeLists.txt +++ b/contrib/zlib-ng-cmake/CMakeLists.txt @@ -10,15 +10,15 @@ if (OS_LINUX OR OS_DARWIN) set (HAVE_UNISTD_H 1) add_definitions(-D_LARGEFILE64_SOURCE=1 -D__USE_LARGEFILE64) add_definitions(-DHAVE_POSIX_MEMALIGN) + add_definitions(-DHAVE_VISIBILITY_INTERNAL) + add_definitions(-DHAVE_VISIBILITY_HIDDEN) + add_definitions(-DHAVE_ATTRIBUTE_ALIGNED) elseif (OS_WINDOWS) set (HAVE_UNISTD_H 0) endif() -add_definitions(-DHAVE_VISIBILITY_HIDDEN) -add_definitions(-DHAVE_VISIBILITY_INTERNAL) add_definitions(-DHAVE_BUILTIN_CTZ) add_definitions(-DHAVE_BUILTIN_CTZLL) -add_definitions(-DHAVE_ATTRIBUTE_ALIGNED) set(ZLIB_ARCH_SRCS) diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt index 28c3fa3df..9c1c569ea 100644 --- a/driver/CMakeLists.txt +++ b/driver/CMakeLists.txt @@ -186,6 +186,10 @@ if (OS_LINUX OR OS_DARWIN) PRIVATE ch_contrib::unixodbc PRIVATE ch_contrib::nanodbc ) +elseif (OS_WINDOWS) + target_link_libraries (${libname}-impl + PRIVATE ODBC::Driver + ) endif() diff --git a/driver/api/odbc.cpp b/driver/api/odbc.cpp index 4b6d9c075..cf3c4ae40 100755 --- a/driver/api/odbc.cpp +++ b/driver/api/odbc.cpp @@ -490,7 +490,7 @@ SQLRETURN SQL_API EXPORTED_FUNCTION_MAYBE_W(SQLDriverConnect)( } SQLRETURN SQL_API EXPORTED_FUNCTION_MAYBE_W(SQLPrepare)(HSTMT statement_handle, SQLTCHAR * statement_text, SQLINTEGER statement_text_size) { - LOG(__FUNCTION__ << " statement_text_size=" << statement_text_size << " statement_text=" << statement_text); + //LOG(__FUNCTION__ << " statement_text_size=" << statement_text_size << " statement_text=" << statement_text); return CALL_WITH_TYPED_HANDLE(SQL_HANDLE_STMT, statement_handle, [&](Statement & statement) { const auto query = toUTF8(statement_text, statement_text_size); @@ -509,7 +509,7 @@ SQLRETURN SQL_API EXPORTED_FUNCTION(SQLExecute)(HSTMT statement_handle) { } SQLRETURN SQL_API EXPORTED_FUNCTION_MAYBE_W(SQLExecDirect)(HSTMT statement_handle, SQLTCHAR * statement_text, SQLINTEGER statement_text_size) { - LOG(__FUNCTION__ << " statement_text_size=" << statement_text_size << " statement_text=" << statement_text); + //LOG(__FUNCTION__ << " statement_text_size=" << statement_text_size << " statement_text=" << statement_text); return CALL_WITH_TYPED_HANDLE(SQL_HANDLE_STMT, statement_handle, [&](Statement & statement) { const auto query = toUTF8(statement_text, statement_text_size);