changeset 11894:0bc372b7ca78

Add Visual Studio 2017 build folders
author indumathi@multicorewareinc.com
date Mon, 30 Oct 2017 14:48:45 +0530
parents df2de6ea407d
children 6a310b24c6a2
files build/vc15-x86/build-all.bat build/vc15-x86/make-solutions.bat build/vc15-x86_64/build-all.bat build/vc15-x86_64/make-solutions.bat build/vc15-x86_64/multilib.bat source/CMakeLists.txt
diffstat 6 files changed, 89 insertions(+-), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/vc15-x86/build-all.bat	Mon Oct 30 14:48:45 2017 +0530
@@ -0,0 +1,14 @@
+@echo off
+if "%VS120COMNTOOLS%" == "" (
+  msg "%username%" "Visual Studio 15 not detected"
+  exit 1
+)
+if not exist x265.sln (
+  call make-solutions.bat
+)
+if exist x265.sln (
+  call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
+  MSBuild /property:Configuration="Release" x265.sln
+  MSBuild /property:Configuration="Debug" x265.sln
+  MSBuild /property:Configuration="RelWithDebInfo" x265.sln
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/vc15-x86/make-solutions.bat	Mon Oct 30 14:48:45 2017 +0530
@@ -0,0 +1,6 @@
+@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 15" ..\..\source && cmake-gui ..\..\source
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/vc15-x86_64/build-all.bat	Mon Oct 30 14:48:45 2017 +0530
@@ -0,0 +1,14 @@
+@echo off
+if "%VS120COMNTOOLS%" == "" (
+  msg "%username%" "Visual Studio 15 not detected"
+  exit 1
+)
+if not exist x265.sln (
+  call make-solutions.bat
+)
+if exist x265.sln (
+  call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
+  MSBuild /property:Configuration="Release" x265.sln
+  MSBuild /property:Configuration="Debug" x265.sln
+  MSBuild /property:Configuration="RelWithDebInfo" x265.sln
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/vc15-x86_64/make-solutions.bat	Mon Oct 30 14:48:45 2017 +0530
@@ -0,0 +1,6 @@
+@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 15 Win64" ..\..\source && cmake-gui ..\..\source
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/vc15-x86_64/multilib.bat	Mon Oct 30 14:48:45 2017 +0530
@@ -0,0 +1,44 @@
+@echo off
+if "%VS120COMNTOOLS%" == "" (
+  msg "%username%" "Visual Studio 15 not detected"
+  exit 1
+)
+
+call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
+
+@mkdir 12bit
+@mkdir 10bit
+@mkdir 8bit
+
+@cd 12bit
+cmake -G "Visual Studio 15 Win64" ../../../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
+)
+
+@cd ..\10bit
+cmake -G "Visual Studio 15 Win64" ../../../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
+)
+
+@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 15 Win64" ../../../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
--- a/source/CMakeLists.txt	Mon Oct 09 17:42:44 2017 +0530
+++ b/source/CMakeLists.txt	Mon Oct 30 14:48:45 2017 +0530
@@ -187,6 +187,11 @@ option(ENABLE_HDR10_PLUS "Enable dynamic
 if(MSVC AND (MSVC_VERSION LESS 1800) AND ENABLE_HDR10_PLUS)
     message(FATAL_ERROR "MSVC version 12.0 or above required to support hdr10plus")
 endif()
+if(WIN32 AND (MSVC_VERSION GREATER 1800))
+	if(CMAKE_VERSION VERSION_LESS 3.7)
+		message(FATAL_ERROR "cmake version not compatible for VS 2017. Update the cmake to versions 3.7 or above")
+	endif()
+endif()	
 if(GCC)
     add_definitions(-Wall -Wextra -Wshadow)
     add_definitions(-D__STDC_LIMIT_MACROS=1)