Kaydet (Commit) f61d6474 authored tarafından Tomoyuki Kubota's avatar Tomoyuki Kubota Kaydeden (comit) Michael Stahl

Initial VS 2019 Support

Change-Id: I8e08efb549ebd52c37183a1185d6de73f2b00601
Reviewed-on: https://gerrit.libreoffice.org/64630Reviewed-by: 's avatarhimajin100000 <himajin100000@gmail.com>
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
Tested-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 3fce6ae2
...@@ -41,7 +41,7 @@ $(eval $(call gb_CppunitTest_use_libraries,basic_macros, \ ...@@ -41,7 +41,7 @@ $(eval $(call gb_CppunitTest_use_libraries,basic_macros, \
ifeq ($(OS),WNT) ifeq ($(OS),WNT)
$(eval $(call gb_CppunitTest_use_system_win32_libs,basic_macros, \ $(eval $(call gb_CppunitTest_use_system_win32_libs,basic_macros, \
oleaut32 \ oleaut32 \
$(if $(filter 150,$(VCVER)),legacy_stdio_definitions) \ $(if $(filter 150 160,$(VCVER)),legacy_stdio_definitions) \
odbc32 \ odbc32 \
odbccp32 \ odbccp32 \
)) ))
......
...@@ -3199,7 +3199,9 @@ map_vs_year_to_version() ...@@ -3199,7 +3199,9 @@ map_vs_year_to_version()
case $1 in case $1 in
2017) 2017)
vsversion=15.0;; vsversion=15;;
2019)
vsversion=16;;
*) *)
AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);; AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
esac esac
...@@ -3217,7 +3219,7 @@ vs_versions_to_check() ...@@ -3217,7 +3219,7 @@ vs_versions_to_check()
vsversions=$vsversion vsversions=$vsversion
else else
# We accept only 2017 # We accept only 2017
vsversions="15.0" vsversions="15"
fi fi
} }
...@@ -3269,37 +3271,40 @@ find_ucrt() ...@@ -3269,37 +3271,40 @@ find_ucrt()
find_msvc() find_msvc()
{ {
# Find Visual C++ 2017 # Find Visual C++ 2017/2019
# Args: $1 (optional) : The VS version year # Args: $1 (optional) : The VS version year
# Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
unset vctest vcnum vcnumwithdot vcbuildnumber unset vctest vcnum vcnumwithdot vcbuildnumber
vs_versions_to_check "$1" vs_versions_to_check "$1"
vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
PathFormat "$vswhere"
vswhere=$formatted_path
for ver in $vsversions; do for ver in $vsversions; do
reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
if test -n "$regvalue"; then if test -n "$vswhereoutput"; then
vctest=$regvalue PathFormat "$vswhereoutput"
break
fi
reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver
if test -n "$regvalue"; then
AC_MSG_RESULT([found: $regvalue])
PathFormat "$regvalue"
vctest=$formatted_path vctest=$formatted_path
break break
fi fi
done done
if test -n "$vctest"; then if test -n "$vctest"; then
vcnumwithdot=$ver vcnumwithdot="$ver.0"
case "$vcnumwithdot" in case "$vcnumwithdot" in
15.0) 15.0)
vcyear=2017 vcyear=2017
vcnum=150 vcnum=150
vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1` ;;
16.0)
vcyear=2019
vcnum=160
;; ;;
esac esac
vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
fi fi
} }
...@@ -3308,7 +3313,6 @@ MSBUILD_PATH= ...@@ -3308,7 +3313,6 @@ MSBUILD_PATH=
DEVENV= DEVENV=
if test "$_os" = "WINNT"; then if test "$_os" = "WINNT"; then
AC_MSG_CHECKING([Visual C++]) AC_MSG_CHECKING([Visual C++])
find_msvc "$with_visual_studio" find_msvc "$with_visual_studio"
if test -z "$vctest"; then if test -z "$vctest"; then
if test -n "$with_visual_studio"; then if test -n "$with_visual_studio"; then
...@@ -3367,13 +3371,21 @@ if test "$_os" = "WINNT"; then ...@@ -3367,13 +3371,21 @@ if test "$_os" = "WINNT"; then
AC_MSG_RESULT([found: $regvalue]) AC_MSG_RESULT([found: $regvalue])
MSBUILD_PATH=`win_short_path_for_make "$regvalue"` MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
else else
if test "$BITNESS_OVERRIDE" = ""; then if test "$vcnumwithdot" = "16.0"; then
regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin" if test "$BITNESS_OVERRIDE" = ""; then
regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
else
regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
fi
else else
regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64" if test "$BITNESS_OVERRIDE" = ""; then
regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
else
regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
fi
fi fi
MSBUILD_PATH=`win_short_path_for_make "$regvalue"` MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
AC_MSG_RESULT([$regvalue]) AC_MSG_RESULT([$regvalue])
fi fi
# Find the version of devenv.exe # Find the version of devenv.exe
...@@ -3466,9 +3478,8 @@ if test "$_os" = "WINNT"; then ...@@ -3466,9 +3478,8 @@ if test "$_os" = "WINNT"; then
# The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
# are always "better", we list them in reverse chronological order. # are always "better", we list them in reverse chronological order.
case $vcnum in case "$vcnum" in
150) 150|160)
COMEX=19
WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A" WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
;; ;;
esac esac
...@@ -5422,9 +5433,11 @@ find_winsdk() ...@@ -5422,9 +5433,11 @@ find_winsdk()
find_msms() find_msms()
{ {
my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
if test $VCVER = 150; then case "$VCVER" in
150|160)
my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}" my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
fi ;;
esac
AC_MSG_CHECKING([for ${my_msm_files}]) AC_MSG_CHECKING([for ${my_msm_files}])
msmdir= msmdir=
for ver in 14.0 15.0; do for ver in 14.0 15.0; do
...@@ -5457,7 +5470,8 @@ find_msms() ...@@ -5457,7 +5470,8 @@ find_msms()
fi fi
dnl Starting from MSVC 15.0, merge modules are located in different directory dnl Starting from MSVC 15.0, merge modules are located in different directory
if test $VCVER = 150; then case "$VCVER" in
150|160)
for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules]) AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/" my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
...@@ -5468,7 +5482,8 @@ find_msms() ...@@ -5468,7 +5482,8 @@ find_msms()
fi fi
done done
done done
fi ;;
esac
if test -n "$msmdir"; then if test -n "$msmdir"; then
msmdir=`cygpath -m "$msmdir"` msmdir=`cygpath -m "$msmdir"`
...@@ -5486,7 +5501,8 @@ find_msms() ...@@ -5486,7 +5501,8 @@ find_msms()
find_msvc_x64_dlls() find_msvc_x64_dlls()
{ {
msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT" msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
if test "$VCVER" = 150; then case "$VCVER" in
150|160)
for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT]) AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT])
if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
...@@ -5498,7 +5514,8 @@ find_msvc_x64_dlls() ...@@ -5498,7 +5514,8 @@ find_msvc_x64_dlls()
break break
fi fi
done done
fi ;;
esac
msvcdlls="msvcp140.dll vcruntime140.dll" msvcdlls="msvcp140.dll vcruntime140.dll"
for dll in $msvcdlls; do for dll in $msvcdlls; do
if ! test -f "$msvcdllpath/$dll"; then if ! test -f "$msvcdllpath/$dll"; then
...@@ -12617,15 +12634,9 @@ if test "$build_os" = "cygwin"; then ...@@ -12617,15 +12634,9 @@ if test "$build_os" = "cygwin"; then
ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl" ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
fi fi
if test "$BITNESS_OVERRIDE" = 64; then if test "$BITNESS_OVERRIDE" = 64; then
if test $VCVER = "150"; then ATL_LIB="$ATL_LIB/x64"
ATL_LIB="$ATL_LIB/x64"
else
ATL_LIB="$ATL_LIB/amd64"
fi
else else
if test $VCVER = "150"; then ATL_LIB="$ATL_LIB/x86"
ATL_LIB="$ATL_LIB/x86"
fi
fi fi
# sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/ # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
PathFormat "/usr/bin/find.exe" PathFormat "/usr/bin/find.exe"
......
...@@ -20,7 +20,8 @@ $(call gb_ExternalProject_get_state_target,coinmp,build) : ...@@ -20,7 +20,8 @@ $(call gb_ExternalProject_get_state_target,coinmp,build) :
/p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
/p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
$(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
$(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
$(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
,CoinMP/MSVisualStudio/v9) ,CoinMP/MSVisualStudio/v9)
else else
......
...@@ -19,7 +19,8 @@ $(call gb_ExternalProject_get_state_target,cppunit,build) : ...@@ -19,7 +19,8 @@ $(call gb_ExternalProject_get_state_target,cppunit,build) :
PROFILEFLAGS="$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \ PROFILEFLAGS="$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
/p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
$(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
$(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \ $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
$(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \
&& msbuild.exe cppunit_dll.vcxproj /p:Configuration=$${PROFILEFLAGS} \ && msbuild.exe cppunit_dll.vcxproj /p:Configuration=$${PROFILEFLAGS} \
&& cd ../DllPlugInTester \ && cd ../DllPlugInTester \
&& msbuild.exe DllPlugInTester.vcxproj /p:Configuration=$${PROFILEFLAGS} \ && msbuild.exe DllPlugInTester.vcxproj /p:Configuration=$${PROFILEFLAGS} \
......
...@@ -19,10 +19,11 @@ $(call gb_ExternalProject_get_state_target,lcms2,build): ...@@ -19,10 +19,11 @@ $(call gb_ExternalProject_get_state_target,lcms2,build):
$(call gb_ExternalProject_run,build,\ $(call gb_ExternalProject_run,build,\
MSBuild.exe lcms2_DLL.vcxproj \ MSBuild.exe lcms2_DLL.vcxproj \
$(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
$(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
$(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
/p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
/p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) /p:TargetName=lcms2 \ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) /p:TargetName=lcms2 \
,Projects/VC2013/lcms2_DLL) ,Projects/VC2017/lcms2_DLL)
else else
$(call gb_ExternalProject_get_state_target,lcms2,build): $(call gb_ExternalProject_get_state_target,lcms2,build):
$(call gb_ExternalProject_run,build,\ $(call gb_ExternalProject_run,build,\
......
...@@ -38,7 +38,8 @@ $(call gb_ExternalProject_get_state_target,python3,build) : ...@@ -38,7 +38,8 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
/p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
/maxcpucount \ /maxcpucount \
$(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
$(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
$(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \
,PCBuild) ,PCBuild)
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment