From 723c2a726eed413e4299039589737f28a3d9ea54 Mon Sep 17 00:00:00 2001
From: cosmonaut <evan@moonside.games>
Date: Sun, 20 Dec 2020 12:14:09 -0800
Subject: [PATCH] fix a bunch of windows build bullshit

---
 .vscode/launch.json       |   4 +-
 .vscode/tasks.json        | 114 ++++++++++++++++----------------------
 ProjectName.Core.sln      |  26 ++++-----
 ProjectName.Framework.sln |  26 ++++-----
 build/CopyFNALibs.targets |   6 +-
 install.sh                |   2 +
 6 files changed, 73 insertions(+), 105 deletions(-)

diff --git a/.vscode/launch.json b/.vscode/launch.json
index cce4741..b176e99 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -6,9 +6,9 @@
       "type": "clr",
       "request": "launch",
       "preLaunchTask": "Build: Framework Debug",
-      "program": "${workspaceFolder}/ProjectName/bin/Debug/net461/ProjectName.exe",
+      "program": "${workspaceFolder}/ProjectName/bin/x64/Debug/net461/ProjectName.exe",
       "args": [],
-      "cwd": "${workspaceFolder}/ProjectName/bin/Debug/net461",
+      "cwd": "${workspaceFolder}/ProjectName/bin/x64/Debug/net461",
       "console": "integratedTerminal",
       "internalConsoleOptions": "neverOpen"
     },
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 90c06a4..c0e059e 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -20,59 +20,9 @@
     "panel": "shared"
   },
   "tasks": [
-    {
-      "label": "Build: Framework Release",
-      "command": "msbuild",
-      "args": [
-        "-restore:True",
-        "${workspaceFolder}/ProjectName.Framework.sln",
-        "-p:Configuration=Release",
-        "-p:Platform=x64"
-      ],
-      "type": "shell",
-      "group": {
-        "kind": "build",
-        "isDefault": true
-      },
-      "problemMatcher": "$msCompile"
-    },
-    {
-      "label": "Run: Framework Release",
-      "command": "mono",
-      "args": [
-        "ProjectName.exe"
-      ],
-      "options": {
-        "env": {
-          "LD_LIBRARY_PATH": "./lib64",
-          "DYLD_LIBRARY_PATH": "./osx"
-        },
-        "cwd": "${workspaceFolder}/ProjectName/bin/Release/net461"
-      },
-      "type": "process",
-      "group": {
-        "kind": "build",
-        "isDefault": true
-      },
-      "problemMatcher": []
-    },
-    {
-      "label": "Build & Run: Framework Release",
-      "dependsOn": [
-        "Build: Framework Release",
-        "Run: Framework Release"
-      ],
-      "dependsOrder": "sequence",
-      "type": "shell",
-      "group": {
-        "kind": "build",
-        "isDefault": true
-      },
-      "problemMatcher": []
-    },
     {
       "label": "Build: Framework Debug",
-      "command": "msbuild",
+      "command": "MsBuild.exe",
       "args": [
         "-restore:True",
         "${workspaceFolder}/ProjectName.Framework.sln",
@@ -88,16 +38,9 @@
     },
     {
       "label": "Run: Framework Debug",
-      "command": "mono",
-      "args": [
-        "ProjectName.exe"
-      ],
+      "command": "ProjectName.exe",
       "options": {
-        "env": {
-          "LD_LIBRARY_PATH": "./lib64",
-          "DYLD_LIBRARY_PATH": "./osx"
-        },
-        "cwd": "${workspaceFolder}/ProjectName/bin/Debug/net461"
+        "cwd": "${workspaceFolder}/ProjectName/bin/x64/Debug/net461"
       },
       "type": "process",
       "group": {
@@ -120,6 +63,49 @@
       },
       "problemMatcher": []
     },
+    {
+      "label": "Build: Framework Release",
+      "command": "MsBuild.exe",
+      "args": [
+        "-restore:True",
+        "${workspaceFolder}/ProjectName.Framework.sln",
+        "-p:Configuration=Release",
+        "-p:Platform=x64"
+      ],
+      "type": "shell",
+      "group": {
+        "kind": "build",
+        "isDefault": true
+      },
+      "problemMatcher": []
+    },
+    {
+      "label": "Run: Framework Release",
+      "command": "ProjectName.exe",
+      "options": {
+        "cwd": "${workspaceFolder}/ProjectName/bin/x64/Release/net461"
+      },
+      "type": "process",
+      "group": {
+        "kind": "build",
+        "isDefault": true
+      },
+      "problemMatcher": []
+    },
+    {
+      "label": "Build & Run: Framework Release",
+      "dependsOn": [
+        "Build: Framework Release",
+        "Run: Framework Release"
+      ],
+      "dependsOrder": "sequence",
+      "type": "shell",
+      "group": {
+        "kind": "build",
+        "isDefault": true
+      },
+      "problemMatcher": []
+    },
     {
       "label": "Build: Mono Release",
       "command": "msbuild",
@@ -237,9 +223,7 @@
       "command": "dotnet",
       "args": [
         "build",
-        "./ProjectName.Core.sln",
-        "-f",
-        "netcoreapp3.1"
+        "./ProjectName.Core.sln"
       ],
       "type": "shell",
       "group": {
@@ -275,9 +259,7 @@
         "build",
         "./ProjectName.Core.sln",
         "--configuration",
-        "Release",
-        "-f",
-        "netcoreapp3.1"
+        "Release"
       ],
       "type": "shell",
       "group": {
diff --git a/ProjectName.Core.sln b/ProjectName.Core.sln
index e733148..ac50130 100644
--- a/ProjectName.Core.sln
+++ b/ProjectName.Core.sln
@@ -5,30 +5,24 @@ VisualStudioVersion = 15.0.26124.0
 MinimumVisualStudioVersion = 15.0.26124.0
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectName.Core", "ProjectName\ProjectName.Core.csproj", "{4589302C-174A-4173-9654-CAA6CA1B5220}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA.Core", "FNA\FNA.Core.csproj", "{D107303E-2AA7-4C9B-BB2A-2D1D75BEFF27}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
 		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
 		Release|x64 = Release|x64
-		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.Build.0 = Debug|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x86.Build.0 = Debug|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|Any CPU.Build.0 = Release|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.ActiveCfg = Release|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.Build.0 = Release|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x86.ActiveCfg = Release|Any CPU
-		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x86.Build.0 = Release|Any CPU
+		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.ActiveCfg = Debug|x64
+		{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.Build.0 = Debug|x64
+		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.ActiveCfg = Release|x64
+		{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.Build.0 = Release|x64
+		{D107303E-2AA7-4C9B-BB2A-2D1D75BEFF27}.Debug|x64.ActiveCfg = Debug|x64
+		{D107303E-2AA7-4C9B-BB2A-2D1D75BEFF27}.Debug|x64.Build.0 = Debug|x64
+		{D107303E-2AA7-4C9B-BB2A-2D1D75BEFF27}.Release|x64.ActiveCfg = Release|x64
+		{D107303E-2AA7-4C9B-BB2A-2D1D75BEFF27}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 EndGlobal
diff --git a/ProjectName.Framework.sln b/ProjectName.Framework.sln
index 80a6667..f4b5a35 100644
--- a/ProjectName.Framework.sln
+++ b/ProjectName.Framework.sln
@@ -5,30 +5,24 @@ VisualStudioVersion = 15.0.26124.0
 MinimumVisualStudioVersion = 15.0.26124.0
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNATemplate.Framework", "ProjectName\ProjectName.Framework.csproj", "{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
 		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
 		Release|x64 = Release|x64
-		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.Build.0 = Debug|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.Build.0 = Debug|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.ActiveCfg = Release|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.Build.0 = Release|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x86.ActiveCfg = Release|Any CPU
-		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x86.Build.0 = Release|Any CPU
+		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.ActiveCfg = Debug|x64
+		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.Build.0 = Debug|x64
+		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.ActiveCfg = Release|x64
+		{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.Build.0 = Release|x64
+		{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x64.ActiveCfg = Debug|x64
+		{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x64.Build.0 = Debug|x64
+		{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x64.ActiveCfg = Release|x64
+		{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 EndGlobal
diff --git a/build/CopyFNALibs.targets b/build/CopyFNALibs.targets
index 3d32f23..de3f83f 100644
--- a/build/CopyFNALibs.targets
+++ b/build/CopyFNALibs.targets
@@ -2,11 +2,7 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
 	<ItemGroup>
-		<Content Include="..\fnalibs\x86\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' AND '$(Platform)' != 'x64'">
-			<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</Content>
-		<Content Include="..\fnalibs\x64\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' AND '$(Platform)' != 'x86'">
+		<Content Include="..\fnalibs\x64\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">
 			<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
 			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
 		</Content>
diff --git a/install.sh b/install.sh
index bf8c2e5..1f04507 100755
--- a/install.sh
+++ b/install.sh
@@ -78,6 +78,8 @@ function getLibs()
         echo "Finished decompressing!"
         echo ""
         rm "$MY_DIR"/fnalibs.tar.bz2
+        #Remove x86 libs because fuck x86
+        rm -rf "$MY_DIR"/fnalibs/x86
     else
         >&2 echo "ERROR: Unable to decompress successfully."
         exit 1