[x265] [PATCH] Added build support for Visual Studio Version 17

Priyadarsini Shanmugam priyadarsini.shanmugam at multicorewareinc.com
Mon Aug 12 04:21:44 UTC 2024


>From 1ba43afc1bc79c8e8175d3b3a37f6e57abaf0b2e Mon Sep 17 00:00:00 2001
From: Priyadarsini <priyadarsini.shanmugam at multicorewareinc.com>
Date: Wed, 7 Aug 2024 16:37:14 +0530
Subject: [PATCH] Added build support for Visual Studio Version 17

---
 build/vc17-x86/build-all.bat         | 23 ++++++++++++++
 build/vc17-x86/make-solutions.bat    |  6 ++++
 build/vc17-x86_64/build-all.bat      | 23 ++++++++++++++
 build/vc17-x86_64/make-solutions.bat |  6 ++++
 build/vc17-x86_64/multilib.bat       | 47 ++++++++++++++++++++++++++++
 5 files changed, 105 insertions(+)
 create mode 100644 build/vc17-x86/build-all.bat
 create mode 100644 build/vc17-x86/make-solutions.bat
 create mode 100644 build/vc17-x86_64/build-all.bat
 create mode 100644 build/vc17-x86_64/make-solutions.bat
 create mode 100644 build/vc17-x86_64/multilib.bat

diff --git a/build/vc17-x86/build-all.bat b/build/vc17-x86/build-all.bat
new file mode 100644
index 000000000..c79032ff4
--- /dev/null
+++ b/build/vc17-x86/build-all.bat
@@ -0,0 +1,23 @@
+ at echo off
+setlocal enabledelayedexpansion
+if "%VS170COMNTOOLS%" == "" (
+for /f "usebackq tokens=1* delims=: " %%i in
(`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
-latest `) do (
+  if /i "%%i"=="productPath" (
+        set VS170COMNTOOLS=%%j
+)
+)
+)
+setx VS170COMNTOOLS "!VS170COMNTOOLS!"
+if "%VS170COMNTOOLS%" == "" (
+  msg "%username%" "Visual Studio 17 not detected"
+  exit 1
+)
+if not exist x265.sln (
+  call make-solutions.bat
+)
+if exist x265.sln (
+  call "%VS170COMNTOOLS%\..\..\tools\VsDevCmd.bat"
+  MSBuild /property:Configuration="Release" x265.sln
+  MSBuild /property:Configuration="Debug" x265.sln
+  MSBuild /property:Configuration="RelWithDebInfo" x265.sln
+)
diff --git a/build/vc17-x86/make-solutions.bat
b/build/vc17-x86/make-solutions.bat
new file mode 100644
index 000000000..43866c001
--- /dev/null
+++ b/build/vc17-x86/make-solutions.bat
@@ -0,0 +1,6 @@
+ at echo off
+::
+:: run this batch file to create a Visual Studio solution file for this
project.
+:: See the cmake documentation for other generator targets
+::
+cmake -G "Visual Studio 17 2022" ..\..\source && cmake-gui ..\..\source
diff --git a/build/vc17-x86_64/build-all.bat
b/build/vc17-x86_64/build-all.bat
new file mode 100644
index 000000000..c79032ff4
--- /dev/null
+++ b/build/vc17-x86_64/build-all.bat
@@ -0,0 +1,23 @@
+ at echo off
+setlocal enabledelayedexpansion
+if "%VS170COMNTOOLS%" == "" (
+for /f "usebackq tokens=1* delims=: " %%i in
(`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
-latest `) do (
+  if /i "%%i"=="productPath" (
+        set VS170COMNTOOLS=%%j
+)
+)
+)
+setx VS170COMNTOOLS "!VS170COMNTOOLS!"
+if "%VS170COMNTOOLS%" == "" (
+  msg "%username%" "Visual Studio 17 not detected"
+  exit 1
+)
+if not exist x265.sln (
+  call make-solutions.bat
+)
+if exist x265.sln (
+  call "%VS170COMNTOOLS%\..\..\tools\VsDevCmd.bat"
+  MSBuild /property:Configuration="Release" x265.sln
+  MSBuild /property:Configuration="Debug" x265.sln
+  MSBuild /property:Configuration="RelWithDebInfo" x265.sln
+)
diff --git a/build/vc17-x86_64/make-solutions.bat
b/build/vc17-x86_64/make-solutions.bat
new file mode 100644
index 000000000..43866c001
--- /dev/null
+++ b/build/vc17-x86_64/make-solutions.bat
@@ -0,0 +1,6 @@
+ at echo off
+::
+:: run this batch file to create a Visual Studio solution file for this
project.
+:: See the cmake documentation for other generator targets
+::
+cmake -G "Visual Studio 17 2022" ..\..\source && cmake-gui ..\..\source
diff --git a/build/vc17-x86_64/multilib.bat b/build/vc17-x86_64/multilib.bat
new file mode 100644
index 000000000..86274f103
--- /dev/null
+++ b/build/vc17-x86_64/multilib.bat
@@ -0,0 +1,47 @@
+ at echo off
+setlocal enabledelayedexpansion
+if "%VS170COMNTOOLS%" == "" (
+for /f "usebackq tokens=1* delims=: " %%i in
(`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
-latest `) do (
+  if /i "%%i"=="productPath" (
+        set VS170COMNTOOLS=%%j
+)
+)
+)
+setx VS170COMNTOOLS "!VS170COMNTOOLS!"
+call "%VS170COMNTOOLS%\..\..\tools\VsDevCmd.bat"
+ at mkdir 12bit
+ at mkdir 10bit
+ at mkdir 8bit
+
+ at cd 12bit
+cmake -G "Visual Studio 17 2022" ../../../source -DHIGH_BIT_DEPTH=ON
-DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  copy/y Release\x265-static.lib ..\8bit\x265-static-main12.lib
+)
+
+ at cd ..\10bit
+cmake -G "Visual Studio 17 2022" ../../../source -DHIGH_BIT_DEPTH=ON
-DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  copy/y Release\x265-static.lib ..\8bit\x265-static-main10.lib
+)
+
+ at cd ..\8bit
+if not exist x265-static-main10.lib (
+  msg "%username%" "10bit build failed"
+  exit 1
+)
+if not exist x265-static-main12.lib (
+  msg "%username%" "12bit build failed"
+  exit 1
+)
+cmake -G "Visual Studio 17 2022" ../../../source
-DEXTRA_LIB="x265-static-main10.lib;x265-static-main12.lib"
-DLINKED_10BIT=ON -DLINKED_12BIT=ON
+if exist x265.sln (
+  MSBuild /property:Configuration="Release" x265.sln
+  :: combine static libraries (ignore warnings caused by winxp.cpp hacks)
+  move Release\x265-static.lib x265-static-main.lib
+  LIB.EXE /ignore:4006 /ignore:4221 /OUT:Release\x265-static.lib
x265-static-main.lib x265-static-main10.lib x265-static-main12.lib
+)
+
+pause
\ No newline at end of file
--
2.45.2.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240812/d3f95e2f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-build-support-for-Visual-Studio-Version-17.patch
Type: application/octet-stream
Size: 5446 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240812/d3f95e2f/attachment.obj>


More information about the x265-devel mailing list