File tree Expand file tree Collapse file tree 6 files changed +22
-3
lines changed Expand file tree Collapse file tree 6 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ ENDIF()
30
30
IF (POLICY CMP0075 )
31
31
CMAKE_POLICY (SET CMP0075 NEW )
32
32
ENDIF ()
33
+ IF (POLICY CMP0069 )
34
+ CMAKE_POLICY (SET CMP0069 NEW )
35
+ ENDIF ()
33
36
34
37
MESSAGE (STATUS "Running cmake version ${CMAKE_VERSION} " )
35
38
Original file line number Diff line number Diff line change @@ -330,3 +330,15 @@ FUNCTION(RESTRICT_SYMBOL_EXPORTS target)
330
330
COMPILE_FLAGS "${COMPILE_FLAGS} ${VISIBILITY_HIDDEN_FLAG} " )
331
331
ENDIF ()
332
332
ENDFUNCTION ()
333
+
334
+ # The MSVC /GL flag, used for link-time code generation
335
+ # creates objects files with a format not readable by tools
336
+ # i.e exporting all symbols is not possible with IPO
337
+ # To workaround this, we disable INTERPROCEDURAL_OPTIMIZATION
338
+ # for some static libraries.
339
+
340
+ FUNCTION (MAYBE_DISABLE_IPO target )
341
+ IF (MSVC AND NOT CLANG_CL )
342
+ SET_TARGET_PROPERTIES (${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF )
343
+ ENDIF ()
344
+ ENDFUNCTION ()
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ INCLUDE_DIRECTORIES(
20
20
SET (DBUG_SOURCES dbug.c )
21
21
ADD_CONVENIENCE_LIBRARY (dbug ${DBUG_SOURCES} )
22
22
TARGET_LINK_LIBRARIES (dbug mysys )
23
+ MAYBE_DISABLE_IPO (dbug )
23
24
24
25
ADD_EXECUTABLE (tests tests.c )
25
26
TARGET_LINK_LIBRARIES (tests dbug )
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ IF(HAVE_MLOCK)
71
71
ENDIF ()
72
72
73
73
ADD_CONVENIENCE_LIBRARY (mysys ${MYSYS_SOURCES} )
74
+ MAYBE_DISABLE_IPO (mysys )
74
75
TARGET_LINK_LIBRARIES (mysys dbug strings ${ZLIB_LIBRARY}
75
76
${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY} )
76
77
DTRACE_INSTRUMENT (mysys )
Original file line number Diff line number Diff line change @@ -188,6 +188,7 @@ MYSQL_ADD_PLUGIN(sql_sequence ha_sequence.cc STORAGE_ENGINE MANDATORY STATIC_ONL
188
188
RECOMPILE_FOR_EMBEDDED )
189
189
190
190
ADD_LIBRARY (sql STATIC ${SQL_SOURCE} )
191
+ MAYBE_DISABLE_IPO (sql )
191
192
DTRACE_INSTRUMENT (sql )
192
193
TARGET_LINK_LIBRARIES (sql
193
194
mysys mysys_ssl dbug strings vio pcre2-8
@@ -234,13 +235,13 @@ IF(MSVC)
234
235
IF (deps )
235
236
LIST (APPEND all_deps ${deps} )
236
237
ENDIF ()
237
- ENDFOREACH ()
238
+ ENDFOREACH ()
238
239
LIST (REMOVE_DUPLICATES all_deps )
239
240
FOREACH (lib ${libs_to_export_symbols} )
240
241
LIST (REMOVE_ITEM all_deps ${lib} )
241
242
ENDFOREACH ()
242
243
243
- TARGET_LINK_LIBRARIES (server
244
+ TARGET_LINK_LIBRARIES (server PRIVATE
244
245
${all_deps}
245
246
sql_builtins
246
247
)
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ ENDIF()
32
32
# Avoid dependencies on perschema data defined in mysys
33
33
ADD_DEFINITIONS (-DDISABLE_MYSQL_THREAD_H )
34
34
ADD_CONVENIENCE_LIBRARY (strings ${STRINGS_SOURCES} )
35
-
35
+ TARGET_LINK_LIBRARIES (strings dbug mysys )
36
+ MAYBE_DISABLE_IPO (strings )
36
37
ADD_EXECUTABLE (conf_to_src EXCLUDE_FROM_ALL conf_to_src.c )
37
38
SET_TARGET_PROPERTIES (conf_to_src PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE )
38
39
TARGET_LINK_LIBRARIES (conf_to_src mysys strings )
You can’t perform that action at this time.
0 commit comments