build: Use DevSim from a VulkanTools build in CI
authorKarl Schultz <karl@lunarg.com>
Fri, 12 Jan 2018 21:41:55 +0000 (14:41 -0700)
committerMike Weiblen <mikew@lunarg.com>
Tue, 16 Jan 2018 18:28:24 +0000 (11:28 -0700)
- Change Travis-CI to build VulkanTools and use the resulting
  DevSim binary instead of the one checked into the repo.
- Delete the DevSim binary and JSON file from layers/linux.
- Remove CMake rules related to DevSim binary.

.travis.yml
layers/CMakeLists.txt
layers/linux/VkLayer_device_simulation.json [deleted file]
layers/linux/libVkLayer_device_simulation.so [deleted file]

index 24bd225..9f568e2 100644 (file)
@@ -37,15 +37,15 @@ cache: ccache
 
 before_install:
   - set -e
-  # Install the appropriate Linux packages.
   - |
     if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
+      # Install the appropriate Linux packages.
       sudo apt-get -qq update
       sudo apt-get -y install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev libx11-xcb-dev
     fi
-  # Install the Android NDK.
   - |
     if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
+      # Install the Android NDK.
       export ARCH=`uname -m`
       wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
       unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
@@ -53,9 +53,9 @@ before_install:
       export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
       export PATH="$ANDROID_NDK_HOME:$PATH"
     fi
-  # Install the clang format diff tool, but only for pull requests.
   - |
     if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
+      # Install the clang format diff tool, but only for pull requests.
       curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
     fi
   # Misc setup
@@ -67,12 +67,34 @@ script:
   - set -e
   - |
     if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
+      # Get VulkanTools and build DevSim
+      mkdir -p external
+      cd external
+      git clone https://github.com/LunarG/VulkanTools.git
+      cd VulkanTools
+      # Get as little as possible from external sources
+      ./update_external_sources.sh --jsoncpp
+      ./update_external_sources.sh --glslang --no-build
+      # Build as few components as possible
+      cmake -H. -Bbuild -DBUILD_LOADER=NO -DBUILD_TESTS=NO \
+          -DBUILD_LAYERS=NO -DBUILD_DEMOS=NO -DBUILD_VKTRACE=NO \
+          -DBUILD_VKJSON=NO -DBUILD_VIA=NO -DBUILD_ICD=NO
+      make -C build -j $core_count
+      cd ${TRAVIS_BUILD_DIR}
+    fi
+  - |
+    if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
+      # Build LVL
       ./update_external_sources.sh
       cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
       make -C dbuild -j $core_count
+    fi
+  - |
+    if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
+      # Run Tests
       (cd dbuild/tests; ./vkvalidatelayerdoc.sh)
       export LD_LIBRARY_PATH=dbuild/loader:$LD_LIBRARY_PATH
-      export VK_LAYER_PATH=dbuild/layers
+      export VK_LAYER_PATH=external/VulkanTools/build/layersvt:dbuild/layers
       export VK_ICD_FILENAMES=dbuild/icd/VkICD_mock_icd.json
       dbuild/tests/vk_layer_validation_tests
       VK_DEVSIM_FILENAME=tests/device_profiles/adreno_540.json dbuild/tests/vk_layer_validation_tests --devsim
@@ -91,11 +113,11 @@ script:
       USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
       popd
     fi
-  # Run the clang format check only for pull request builds because the
-  # master branch is needed to do the git diff.
   - |
     if [[ "$CHECK_FORMAT" == "ON" ]]; then
       if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
+        # Run the clang format check only for pull request builds because the
+        # master branch is needed to do the git diff.
         echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
         ./scripts/check_code_format.sh
       else
index 53beccb..eb23788 100644 (file)
@@ -39,14 +39,6 @@ set(LAYER_JSON_FILES_NO_DEPENDENCIES
 
 set(LAYER_JSON_FILES ${LAYER_JSON_FILES_WITH_DEPENDENCIES} ${LAYER_JSON_FILES_NO_DEPENDENCIES})
 
-set(LAYER_BINARY_JSON_FILES
-    VkLayer_device_simulation
-    )
-
-set(LAYER_BINARY_FILES
-    libVkLayer_device_simulation
-    )
-
 if (WIN32)
         if (CMAKE_GENERATOR MATCHES "^Visual Studio.*")
             foreach (config_file ${LAYER_JSON_FILES})
@@ -85,18 +77,6 @@ else()
                 VERBATIM
                 )
         endforeach(config_file)
-        foreach (config_file ${LAYER_BINARY_JSON_FILES})
-            add_custom_target(${config_file}-bin-json ALL
-                COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.json
-                VERBATIM
-                )
-        endforeach(config_file)
-        foreach (config_file ${LAYER_BINARY_FILES})
-            add_custom_target(${config_file}-so ALL
-                COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.so
-                VERBATIM
-                )
-        endforeach(config_file)
         # Add link to vk_validation_error_messages.h in build dir for scripts to pick up
         add_custom_target(vk_validation_error_messages ALL
             COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/vk_validation_error_messages.h
@@ -113,14 +93,6 @@ if ((Win32) OR (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
     foreach (config_file ${LAYER_JSON_FILES_NO_DEPENDENCIES})
         add_dependencies(${config_file}-json VkLayer_utils)
     endforeach(config_file)
-    if(UNIX)
-        foreach (config_file ${LAYER_BINARY_JSON_FILES})
-            add_dependencies(${config_file}-bin-json VkLayer_utils)
-        endforeach(config_file)
-        foreach (config_file ${LAYER_BINARY_FILES})
-            add_dependencies(${config_file}-so VkLayer_utils)
-        endforeach(config_file)
-    endif()
 endif()
 
 # Add targets for JSON file install on Linux.
diff --git a/layers/linux/VkLayer_device_simulation.json b/layers/linux/VkLayer_device_simulation.json
deleted file mode 100644 (file)
index 0cf0fdd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-    "file_format_version" : "1.1.0",
-    "layer" : {
-        "name": "VK_LAYER_LUNARG_device_simulation",
-        "type": "GLOBAL",
-        "library_path": "./libVkLayer_device_simulation.so",
-        "api_version": "1.0.67",
-        "implementation_version": "1.2.0",
-        "description": "LunarG device simulation layer"
-    }
-}
diff --git a/layers/linux/libVkLayer_device_simulation.so b/layers/linux/libVkLayer_device_simulation.so
deleted file mode 100755 (executable)
index 3bfea56..0000000
Binary files a/layers/linux/libVkLayer_device_simulation.so and /dev/null differ