]> granicus.if.org Git - libvpx/commitdiff
gen_msvs_sln: Support producing versions 10 and 11, handle vcxproj files
authorMartin Storsjo <martin@martin.st>
Thu, 16 May 2013 21:59:20 +0000 (00:59 +0300)
committerMartin Storsjo <martin@martin.st>
Tue, 21 May 2013 06:57:01 +0000 (09:57 +0300)
Change-Id: I3c23a2ce383d9291a823d2be7364608ce0e01570

build/make/gen_msvs_sln.sh
build/make/gen_msvs_vcxproj.sh

index 240678b6455388dc09f4c9e92cf85c51b8fd1385..5a8c793682343e69ba1a56ded1479f4d5232600b 100755 (executable)
@@ -25,7 +25,7 @@ files.
 Options:
     --help                      Print this message
     --out=outfile               Redirect output to a file
-    --ver=version               Version (7,8,9) of visual studio to generate for
+    --ver=version               Version (7,8,9,10,11) of visual studio to generate for
     --target=isa-os-cc          Target specifier
 EOF
     exit 1
@@ -55,14 +55,19 @@ indent_pop() {
 
 parse_project() {
     local file=$1
-    local name=`grep Name "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
-    local guid=`grep ProjectGUID "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
+    if [ "$sfx" = "vcproj" ]; then
+        local name=`grep Name "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
+        local guid=`grep ProjectGUID "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
+    else
+        local name=`grep RootNamespace "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
+        local guid=`grep ProjectGuid "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
+    fi
 
     # save the project GUID to a varaible, normalizing to the basename of the
     # vcproj file without the extension
     local var
     var=${file##*/}
-    var=${var%%.vcproj}
+    var=${var%%.${sfx}}
     eval "${var}_file=\"$1\""
     eval "${var}_name=$name"
     eval "${var}_guid=$guid"
@@ -83,14 +88,14 @@ process_project() {
     # vcproj file without the extension
     local var
     var=${file##*/}
-    var=${var%%.vcproj}
+    var=${var%%.${sfx}}
     eval "${var}_guid=$guid"
 
     echo "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"$name\", \"$file\", \"$guid\""
     indent_push
 
     eval "local deps=\"\${${var}_deps}\""
-    if [ -n "$deps" ]; then
+    if [ -n "$deps" ] && [ "$sfx" = "vcproj" ]; then
         echo "${indent}ProjectSection(ProjectDependencies) = postProject"
         indent_push
 
@@ -221,7 +226,7 @@ for opt in "$@"; do
     ;;
     --ver=*) vs_ver="$optval"
              case $optval in
-             [789])
+             [789]|10|11)
              ;;
              *) die Unrecognized Visual Studio Version in $opt
              ;;
@@ -257,6 +262,20 @@ case "${vs_ver:-8}" in
     9) sln_vers="10.00"
        sln_vers_str="Visual Studio 2008"
     ;;
+    10) sln_vers="11.00"
+       sln_vers_str="Visual Studio 2010"
+    ;;
+    11) sln_vers="12.00"
+       sln_vers_str="Visual Studio 2012"
+    ;;
+esac
+case "${vs_ver:-8}" in
+    [789])
+    sfx=vcproj
+    ;;
+    10|11)
+    sfx=vcxproj
+    ;;
 esac
 
 for f in "${file_list[@]}"; do
index e7f8f8503538c16e3fb3a2a697e859439f5b79d7..38ffa267c966cb7ed4b23a2b5a0d3755e24df0a9 100755 (executable)
@@ -358,7 +358,9 @@ generate_vcxproj() {
             else
                 tag_content ConfigurationType StaticLibrary
             fi
-            tag_content PlatformToolset v110 # v110_wp80, omit for v10
+            if [ "$vs_ver" = "11" ]; then
+                tag_content PlatformToolset v110
+            fi
             tag_content CharacterSet Unicode
             if [ "$config" = "Release" ]; then
                 tag_content WholeProgramOptimization true