summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2015-11-06 17:24:23 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2015-11-06 17:27:24 +0100
commitf1daf9ced46ba65b025a92f512833c86d04e7cf2 (patch)
treed8c63373681dde1e5db37d76019df110eb75b4cf /win
parenta36048d143c2e3cd956009849dc28f4a714d00d0 (diff)
downloadmariadb-git-f1daf9ced46ba65b025a92f512833c86d04e7cf2.tar.gz
MDEV-9024 Build fails with VS2015
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.txt60
-rw-r--r--win/packaging/ca/CMakeLists.txt42
2 files changed, 44 insertions, 58 deletions
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt
index 3b9b72f48fd..0535a486d57 100644
--- a/win/packaging/CMakeLists.txt
+++ b/win/packaging/CMakeLists.txt
@@ -17,36 +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{ProgramFiles}/WiX Toolset v3.9/bin"
- "$ENV{WIX}/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 ccd03130d69..c57ae4b2113 100644
--- a/win/packaging/ca/CMakeLists.txt
+++ b/win/packaging/ca/CMakeLists.txt
@@ -13,53 +13,13 @@
# 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")
-ELSEIF(MSVC_VERSION EQUAL 1800 OR MSVC_VERSION EQUAL 1900 )
- SET(WIX35_MSVC_SUFFIX "_2013")
- SET(WIX36_MSVC_SUFFIX "VS2013")
-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})