diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-06 22:41:58 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-06 22:41:58 +0100 |
commit | c4cb24006139bb6a619ca9d6b00d00c2275d2c28 (patch) | |
tree | a9edb0480f4e20aef8c15f2e415f56d2c7681feb /win | |
parent | 1e361f286bc2cd42c79a4c0ac40209d222e60b11 (diff) | |
download | mariadb-git-c4cb24006139bb6a619ca9d6b00d00c2275d2c28.tar.gz |
MDEV-9024 Build fails with VS2015
cherry-pick f1daf9ce from 10.0 branch
-------------------------------------
Fix build failures caused by new C runtime library
- isnan, snprintf, struct timespec are now defined, attempt to
redefine them leads
- P_tmpdir, tzname are no more defined
- lfind() and lsearch() in lf_hash.c had to be renamed, declaration
conflicts with some C runtime functions with the same name declared in
a header included by stdlib.h
Also fix couple of annoying warnings :
- remove #define NOMINMAX from config.h to avoid "redefined" compiler
warnings(NOMINMAX is already in compile flags)
- disable incremental linker in Debug as well (feature not used much
and compiler crashes often)
Also simplify package building with Wix, require Wix 3.9 or later
(VS2015 is not compatible with old Wix 3.5/3.6)
Diffstat (limited to 'win')
-rw-r--r-- | win/packaging/CMakeLists.txt | 61 | ||||
-rw-r--r-- | win/packaging/ca/CMakeLists.txt | 41 |
2 files changed, 45 insertions, 57 deletions
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index 95547ac9f3a..0535a486d57 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -17,35 +17,62 @@ IF(NOT WIN32) RETURN() ENDIF() +IF(MSVC_VERSION LESS 1600) + RETURN() +ENDIF() + + + SET(MANUFACTURER "MariaDB Corporation Ab") FIND_PATH(WIX_DIR heat.exe - $ENV{WIX_DIR}/bin - $ENV{ProgramFiles}/wix/bin - "$ENV{ProgramFiles}/Windows Installer XML v3/bin" - "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin" - "$ENV{ProgramFiles}/Windows Installer XML v3.6/bin" - "$ENV{WIX}/bin" + "$ENV{ProgramFiles}/WiX Toolset v3.9/bin" + "$ENV{ProgramFiles}/WiX Toolset v3.10/bin" ) - SET(CPACK_WIX_PACKAGE_BASE_NAME "MariaDB") IF(CMAKE_SIZEOF_VOID_P EQUAL 4) SET(CPACK_WIX_UPGRADE_CODE "49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3") - SET(CPACK_WIX_PACKAGE_NAME "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@") + SET(CPACK_WIX_PACKAGE_NAME "MariaDB ${MAJOR_VERSION}.${MINOR_VERSION}") ELSE() SET(CPACK_WIX_UPGRADE_CODE "2331E7BD-EE58-431B-9E18-B2B918BCEB1B") - SET(CPACK_WIX_PACKAGE_NAME "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@ (x64)") + SET(CPACK_WIX_PACKAGE_NAME "MariaDB ${MAJOR_VERSION}.${MINOR_VERSION} (x64)") ENDIF() +IF(WIX_DIR) +IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(WIX_ARCH_SUFFIX "x64") +ELSE() + SET(WIX_ARCH_SUFFIX "x86") +ENDIF() +# Need some Wix SDK libraries to link with customaction +IF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 ) + SET(WIX_MSVC_SUFFIX "VS2010") +ELSEIF(MSVC_VERSION EQUAL 1800) + SET(WIX_MSVC_SUFFIX "VS2013") +ELSEIF (MSVC_VERSION EQUAL 1900) + SET(WIX_MSVC_SUFFIX "VS2015") +ENDIF() + + +FIND_LIBRARY(WIX_WCAUTIL_LIBRARY + NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} + wcautil + PATHS + ${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/lib/${WIX_ARCH_SUFFIX} + ) + +FIND_LIBRARY(WIX_DUTIL_LIBRARY + NAMES dutil${WIX_ARCH_SUFFIX} + dutil + PATHS + ${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/lib/${WIX_ARCH_SUFFIX} + ) +ENDIF() -IF(NOT WIX_DIR) - IF(NOT _WIX_DIR_CHECKED) - SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "") - MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated") - IF(BUILD_RELEASE) +IF(NOT WIX_DUTIL_LIBRARY) + MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated") + IF(BUILD_RELEASE) MESSAGE(FATAL_ERROR - "Can't find Wix. It is necessary for producing official package" - ) - ENDIF() + "Can't find Wix. It is necessary for producing official package") ENDIF() RETURN() ENDIF() diff --git a/win/packaging/ca/CMakeLists.txt b/win/packaging/ca/CMakeLists.txt index 0da1e5d67b1..04d5408b9c9 100644 --- a/win/packaging/ca/CMakeLists.txt +++ b/win/packaging/ca/CMakeLists.txt @@ -13,50 +13,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/inc) -LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib) - +INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/inc) SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql) -IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(WIX_ARCH_SUFFIX "_x64") - SET(WIX36_ARCH_SUFFIX "x64") -ELSE() - SET(WIX_ARCH_SUFFIX) - SET(WIX36_ARCH_SUFFIX "x86") -ENDIF() - -IF(MSVC_VERSION EQUAL 1400) - SET(WIX35_MSVC_SUFFIX "_2005") -ELSEIF(MSVC_VERSION EQUAL 1500) - SET(WIX35_MSVC_SUFFIX "_2008") - SET(WIX36_MSVC_SUFFIX "VS2008") -ELSEIF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 ) - SET(WIX35_MSVC_SUFFIX "_2010") - SET(WIX36_MSVC_SUFFIX "VS2010") -ELSE() - # When next VS is out, add the correct version here - MESSAGE(FATAL_ERROR "Unknown VS version") -ENDIF() -INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/inc) - -FIND_LIBRARY(WIX_WCAUTIL_LIBRARY - NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} - wcautil - PATHS - ${WIX_DIR}/../SDK/lib - ${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX}) - -FIND_LIBRARY(WIX_DUTIL_LIBRARY - NAMES dutil${WIX_ARCH_SUFFIX} dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} - dutil - PATHS - ${WIX_DIR}/../SDK/lib - ${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX} - ) - ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES) ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES}) TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY} |