CMake: clean up cppdap usage

Remove unused and useless variables. Also fix the build when
SWIFTSHADER_ENABLE_VULKAN_DEBUGGER is enabled.

Bug: b/145758253
Change-Id: Ie49dd88d6716b24fe31baa8f8d162e7dacfa5a3c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43268
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fe9c34..5593fa4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -312,9 +312,6 @@
 set(VULKAN_DIR ${SOURCE_DIR}/Vulkan)
 set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
 set(ASTC_DIR ${THIRD_PARTY_DIR}/astc-encoder)
-set(CPPDAP_DIR ${THIRD_PARTY_DIR}/cppdap)
-set(CPPDAP_INCLUDE_DIR ${CPPDAP_DIR}/include)
-set(JSON_INCLUDE_DIR ${THIRD_PARTY_DIR}/json/include)
 set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
 set(HELLO2_DIR ${THIRD_PARTY_DIR}/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2)
 
@@ -609,7 +606,7 @@
 ###########################################################
 if(SWIFTSHADER_BUILD_CPPDAP)
     set(CPPDAP_THIRD_PARTY_DIR ${THIRD_PARTY_DIR})
-    add_subdirectory(${CPPDAP_DIR})
+    add_subdirectory(third_party/cppdap)
 endif()
 
 
@@ -628,7 +625,6 @@
 
 set(VULKAN_INCLUDE_DIR
     ${COMMON_INCLUDE_DIR}
-    ${CPPDAP_INCLUDE_DIR}
 )
 
 ###########################################################
diff --git a/src/Vulkan/Debug/Variable.hpp b/src/Vulkan/Debug/Variable.hpp
index 08e802d..4b76c7a 100644
--- a/src/Vulkan/Debug/Variable.hpp
+++ b/src/Vulkan/Debug/Variable.hpp
@@ -19,6 +19,7 @@
 #include "Type.hpp"
 #include "Value.hpp"
 
+#include <algorithm>
 #include <memory>
 #include <mutex>
 #include <string>
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp
index 3e9aea5..364c318 100644
--- a/src/Vulkan/VkCommandBuffer.cpp
+++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -14,6 +14,7 @@
 
 #include "VkCommandBuffer.hpp"
 #include "VkBuffer.hpp"
+#include "VkDevice.hpp"
 #include "VkEvent.hpp"
 #include "VkFence.hpp"
 #include "VkFramebuffer.hpp"