2020-05-18 11:00:28 +00:00
|
|
|
IF((NOT MSVC) OR CLANG_CL OR WITH_ASAN)
|
2011-01-29 19:02:43 +01:00
|
|
|
RETURN()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
# We need MFC
|
2018-05-30 21:37:51 +00:00
|
|
|
# /permissive- flag does not play well with MFC, disable it.
|
|
|
|
STRING(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2021-11-19 14:03:51 +01:00
|
|
|
REMOVE_DEFINITIONS(-DNOSERVICE) # fixes "already defined" warning in an AFX header
|
2018-05-30 21:37:51 +00:00
|
|
|
|
2011-01-29 19:02:43 +01:00
|
|
|
FIND_PACKAGE(MFC)
|
|
|
|
IF(NOT MFC_FOUND)
|
2011-02-03 21:02:20 +01:00
|
|
|
IF(BUILD_RELEASE)
|
|
|
|
MESSAGE(FATAL_ERROR
|
|
|
|
"Can't find MFC. It is necessary for producing official package"
|
|
|
|
)
|
|
|
|
ENDIF()
|
2011-01-29 19:02:43 +01:00
|
|
|
RETURN()
|
2011-02-03 21:02:20 +01:00
|
|
|
ENDIF()
|
2018-10-08 22:48:58 +01:00
|
|
|
|
2017-03-30 13:11:34 +00:00
|
|
|
IF(MSVC_CRT_TYPE MATCHES "/MD")
|
2018-10-08 22:48:58 +01:00
|
|
|
# FORCE static CRT and MFC for upgrade wizard,
|
|
|
|
# so we do not have to redistribute MFC.
|
|
|
|
FORCE_STATIC_CRT()
|
|
|
|
SET(UPGRADE_WIZARD_SOURCES ${CMAKE_SOURCE_DIR}/sql/winservice.c)
|
2017-03-30 13:11:34 +00:00
|
|
|
ELSE()
|
2018-10-08 22:48:58 +01:00
|
|
|
SET(UPGRADE_WIZARD_LINK_LIBRARIES winservice)
|
2017-03-30 13:11:34 +00:00
|
|
|
ENDIF()
|
2018-10-08 22:48:58 +01:00
|
|
|
|
|
|
|
# MFC should be statically linked
|
|
|
|
SET(CMAKE_MFC_FLAG 1)
|
|
|
|
|
2011-01-29 19:02:43 +01:00
|
|
|
# Enable exception handling (avoids warnings)
|
2018-02-19 15:21:54 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc -DNO_WARN_MBCS_MFC_DEPRECATION")
|
2011-01-29 19:02:43 +01:00
|
|
|
|
2011-01-30 22:27:59 +01:00
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
|
2020-03-20 16:41:54 +02:00
|
|
|
MYSQL_ADD_EXECUTABLE(mariadb-upgrade-wizard
|
2018-10-08 22:48:58 +01:00
|
|
|
upgrade.cpp upgradeDlg.cpp upgrade.rc ${UPGRADE_WIZARD_SOURCES}
|
2011-01-29 19:02:43 +01:00
|
|
|
COMPONENT Server)
|
2020-08-12 21:18:21 +02:00
|
|
|
|
|
|
|
|
2020-03-20 16:41:54 +02:00
|
|
|
TARGET_LINK_LIBRARIES(mariadb-upgrade-wizard ${UPGRADE_WIZARD_LINK_LIBRARIES})
|
2011-01-29 19:02:43 +01:00
|
|
|
# upgrade_wizard is Windows executable, set WIN32_EXECUTABLE so it does not
|
|
|
|
# create a console.
|
2020-08-12 21:18:21 +02:00
|
|
|
SET_TARGET_PROPERTIES(mariadb-upgrade-wizard PROPERTIES
|
|
|
|
WIN32_EXECUTABLE 1
|
|
|
|
LINK_FLAGS "/MANIFESTUAC:level='requireAdministrator'"
|
2011-01-29 19:02:43 +01:00
|
|
|
)
|