build: Add googletest dependency for testing
authorCharles Giessen <charles@lunarg.com>
Thu, 15 Jun 2023 20:05:29 +0000 (14:05 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 16 Jun 2023 21:06:03 +0000 (15:06 -0600)
scripts/CMakeLists.txt
scripts/known_good.json

index 19a58bf..7454567 100644 (file)
@@ -112,6 +112,9 @@ endif()
 if (MOLTENVK_REPO_ROOT)
     list(APPEND CMAKE_PREFIX_PATH ${MOLTENVK_REPO_ROOT})
 endif()
+if (GOOGLETEST_INSTALL_DIR)
+    list(APPEND CMAKE_PREFIX_PATH ${GOOGLETEST_INSTALL_DIR})
+endif()
 
 if (CMAKE_CROSSCOMPILING)
     set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
index 5cb5b30..e00a26a 100644 (file)
@@ -1,56 +1,73 @@
 {
-  "repos" : [
-    {
-      "name" : "Vulkan-Headers",
-      "api": "vulkan",
-      "url" : "https://github.com/KhronosGroup/Vulkan-Headers.git",
-      "sub_dir" : "Vulkan-Headers",
-      "build_dir" : "Vulkan-Headers/build",
-      "install_dir" : "Vulkan-Headers/build/install",
-      "commit": "v1.3.254"
-    },
-    {
-      "name" : "MoltenVK",
-      "url" : "https://github.com/KhronosGroup/MoltenVK.git",
-      "sub_dir" : "MoltenVK",
-      "build_dir" : "MoltenVK",
-      "install_dir" : "MoltenVK",
-      "commit" : "v1.2.4",
-      "custom_build" : [
-        "./fetchDependencies --macos --no-parallel-build",
-        "xcodebuild -project MoltenVKPackaging.xcodeproj GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS MVK_CONFIG_LOG_LEVEL=1' -scheme \"MoltenVK Package (macOS only)\" build"
-      ],
-      "build_step" : "custom",
-      "build_platforms" : [
-        "darwin"
-      ]
-    },
-    {
-      "name" : "Vulkan-Loader",
-      "api": "vulkan",
-      "url" : "https://github.com/KhronosGroup/Vulkan-Loader.git",
-      "sub_dir" : "Vulkan-Loader",
-      "build_dir" : "Vulkan-Loader/build",
-      "install_dir" : "Vulkan-Loader/build/install",
-      "commit": "v1.3.254",
-      "deps" : [
+    "repos": [
         {
-          "var_name" : "VULKAN_HEADERS_INSTALL_DIR",
-          "repo_name" : "Vulkan-Headers"
+            "name": "Vulkan-Headers",
+            "api": "vulkan",
+            "url": "https://github.com/KhronosGroup/Vulkan-Headers.git",
+            "sub_dir": "Vulkan-Headers",
+            "build_dir": "Vulkan-Headers/build",
+            "install_dir": "Vulkan-Headers/build/install",
+            "commit": "v1.3.254"
+        },
+        {
+            "name": "MoltenVK",
+            "url": "https://github.com/KhronosGroup/MoltenVK.git",
+            "sub_dir": "MoltenVK",
+            "build_dir": "MoltenVK",
+            "install_dir": "MoltenVK",
+            "commit": "v1.2.4",
+            "custom_build": [
+                "./fetchDependencies --macos --no-parallel-build",
+                "xcodebuild -project MoltenVKPackaging.xcodeproj GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS MVK_CONFIG_LOG_LEVEL=1' -scheme \"MoltenVK Package (macOS only)\" build"
+            ],
+            "build_step": "custom",
+            "build_platforms": [
+                "darwin"
+            ]
+        },
+        {
+            "name": "Vulkan-Loader",
+            "api": "vulkan",
+            "url": "https://github.com/KhronosGroup/Vulkan-Loader.git",
+            "sub_dir": "Vulkan-Loader",
+            "build_dir": "Vulkan-Loader/build",
+            "install_dir": "Vulkan-Loader/build/install",
+            "commit": "v1.3.254",
+            "deps": [
+                {
+                    "var_name": "VULKAN_HEADERS_INSTALL_DIR",
+                    "repo_name": "Vulkan-Headers"
+                }
+            ],
+            "cmake_options": [
+                "-DBUILD_TESTS=NO"
+            ],
+            "build_platforms": [
+                "linux",
+                "darwin"
+            ]
+        },
+        {
+            "name": "googletest",
+            "url": "https://github.com/google/googletest.git",
+            "sub_dir": "googletest",
+            "build_dir": "googletest/build",
+            "install_dir": "googletest/build/install",
+            "cmake_options": [
+                "-DBUILD_GMOCK=OFF",
+                "-Dgtest_force_shared_crt=ON",
+                "-DBUILD_SHARED_LIBS=OFF"
+            ],
+            "commit": "v1.13.0",
+            "optional": [
+                "tests"
+            ]
         }
-      ],
-      "cmake_options" : [
-        "-DBUILD_TESTS=NO"
-      ],
-      "build_platforms" : [
-        "linux",
-        "darwin"
-      ]
-    }
-  ],
-  "install_names" : {
-      "Vulkan-Headers" : "VULKAN_HEADERS_INSTALL_DIR",
-      "Vulkan-Loader" : "VULKAN_LOADER_INSTALL_DIR",
-      "MoltenVK" : "MOLTENVK_REPO_ROOT"
+    ],
+    "install_names": {
+        "Vulkan-Headers": "VULKAN_HEADERS_INSTALL_DIR",
+        "Vulkan-Loader": "VULKAN_LOADER_INSTALL_DIR",
+        "MoltenVK": "MOLTENVK_REPO_ROOT",
+        "googletest": "GOOGLETEST_INSTALL_DIR"
     }
 }