File tree Expand file tree Collapse file tree 9 files changed +22
-7
lines changed Expand file tree Collapse file tree 9 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,16 @@ if(CMAKE_GENERATOR_TOOLSET)
95
95
set (set_toolset -T ${CMAKE_GENERATOR_TOOLSET} )
96
96
endif ()
97
97
98
+ set (set_system_name )
99
+ if (CMAKE_SYSTEM_NAME )
100
+ set (set_system_name -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} )
101
+ endif ()
102
+
103
+ set (set_system_processor )
104
+ if (CMAKE_SYSTEM_PROCESSOR )
105
+ set (set_system_processor -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} )
106
+ endif ()
107
+
98
108
if (NOT EXISTS "${PB_BINARY_DIR} /exports.cmake" )
99
109
100
110
message ("==== Configuring Protobuf build using cmake generator: ${CMAKE_GENERATOR} ${set_arch} ${set_toolset} " )
@@ -114,6 +124,8 @@ if(NOT EXISTS "${PB_BINARY_DIR}/exports.cmake")
114
124
${set_arch}
115
125
${set_toolset}
116
126
${set_build_type}
127
+ ${set_system_name}
128
+ ${set_system_processor}
117
129
-DSTATIC_MSVCRT=${STATIC_MSVCRT}
118
130
-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
119
131
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@@ -322,7 +334,7 @@ function(mysqlx_protobuf_generate_cpp SRCS HDRS)
322
334
set_source_files_properties (${srcs}
323
335
APPEND_STRING PROPERTY COMPILE_FLAGS "-w"
324
336
)
325
- ELSE ( WIN32 )
337
+ ELSEIF ( MSVC )
326
338
set_source_files_properties (${srcs}
327
339
APPEND_STRING PROPERTY COMPILE_FLAGS
328
340
"/W1 /wd4018 /wd4996 /wd4244 /wd4267"
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
141
141
# -------------------------------------------------------------------------
142
142
# Disable compile warnings
143
143
144
- if (WIN32 )
144
+ if (MSVC )
145
145
146
146
add_compile_options (
147
147
/wd4996
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ target_link_libraries(cdk_foundation
94
94
)
95
95
96
96
IF (WIN32 )
97
- target_link_libraries (cdk_foundation PRIVATE Dnsapi )
97
+ target_link_libraries (cdk_foundation PRIVATE dnsapi )
98
98
ELSEIF (NOT FREEBSD )
99
99
target_link_libraries (cdk_foundation PRIVATE resolv )
100
100
ENDIF ()
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ POP_SYS_WARNINGS_CDK
49
49
#pragma comment directive.
50
50
*/
51
51
52
- #ifdef _WIN32
52
+ #ifdef _MSC_VER
53
53
#pragma comment(lib,"ws2_32")
54
54
#if defined(WITH_SSL)
55
55
#if OPENSSL_VERSION_NUMBER < 0x10100000L
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ namespace detail {
73
73
74
74
Used for handling Winsock errors.
75
75
*/
76
+ const error_category& winsock_error_category ();
76
77
77
78
class error_category_winsock : public error_category_base
78
79
{
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ ADD_DEFINITIONS(-DSIZEOF_LONG=${SIZEOF_LONG} -DSIZEOF_LONG_LONG=${SIZEOF_LONG_LO
33
33
34
34
# TODO: Fix compile warnings in auth_mysql41.cc
35
35
36
- if (WIN32 )
36
+ if (MSVC )
37
37
set_property (SOURCE auth_hash.cc
38
38
PROPERTY COMPILE_FLAGS "/W3"
39
39
)
Original file line number Diff line number Diff line change 35
35
#include " tokenizer.h"
36
36
37
37
38
- #ifdef _WIN32
38
+ #ifdef _MSC_VER
39
39
40
40
/*
41
41
4061 = enum constant not explicitly handled by switch() case.
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ if(APPLE)
163
163
164
164
endif ()
165
165
166
- if (WIN32 )
166
+ if (MSVC )
167
167
168
168
add_compile_options (
169
169
/wd4018
Original file line number Diff line number Diff line change @@ -118,7 +118,9 @@ std::string get_os_version_info(std::string &platform)
118
118
else
119
119
{
120
120
PUSH_SYS_WARNINGS
121
+ #ifdef _MSC_VER
121
122
DISABLE_WARNING (4996 )
123
+ #endif
122
124
if (GetVersionEx (&ver) == 0 )
123
125
ver_info << " <unknown>" ;
124
126
POP_SYS_WARNINGS
You can’t perform that action at this time.
0 commit comments