build: CMakeLists cleanup and modernization

Includes: using modern CMake idioms, removing dead code/variables,
simplifying conditionals, and some cosmetic/whitespace changes.

Apply warning flag only the appropriate compiler

Remove unneeded cmake_minimum_required()

Make platform-specific if/then trees consistent.  Use CMake's platform
specifier variables with a consistent conditional tree structure.

Remove unused MAJOR variable

Clean declaration and use of API_NAME variable

Add PRIVATE to limit scope of add target_link_libraries()

Inline the unneeded run_external_revision_generate() macro

Remove redundant VkLayer_utils declaration

Remove redundant add_dependencies()

Rename macro from run_vk_xml_generate to GenerateFromVkXml.
Rename macro from add_vk_layer to AddVkLayer
Rename macro add_test_layer to AddVkLayer
For consistency with Vulkan-Loader repo, and at least notionally with
the C++ style guide, use camel-case names for macros.

Move macro invocations closer to macro definition

Rename variable LAYER_JSON_FILES to TEST_LAYER_NAME.
Use better name for variable containing a single object.

Use varialble TEST_LAYER_NAME to remove repetition.
Avoid many reuses of explicit name by using variable.

Remove deprecated use of CMAKE_{C|CXX}_FLAGS

Use modern target_compile_definitions() and target_compile_options()

Use target_include_directories()

Replace deprecated include_directories() with modern construct.

Remove unneeded foreach() over a single element.

Replace deprecated set_target_properties() with target_compile_options()

Add vk_safe_struct.cpp as a generated dependency.

Rework/simplify setting of compiler flags and standards.

Cosmetics (comments, rulers, whitespace)

Reformat with cmake_format v0.4.1

Change-Id: I9b2ed43c09030b44f6a779dc2243464f45ce5e2a
5 files changed
tree: a5716ee81aaee7d520e405be16920046ef73aa33
  1. build-android/
  2. cmake/
  3. docs/
  4. external/
  5. layers/
  6. scripts/
  7. tests/
  8. .appveyor.yml
  9. .clang-format
  10. .cmake-format.py
  11. .gitattributes
  12. .gitignore
  13. .travis.yml
  14. BUILD.md
  15. CMakeLists.txt
  16. CODE_OF_CONDUCT.md
  17. CONTRIBUTING.md
  18. COPYRIGHT.txt
  19. GOVERNANCE.md
  20. LICENSE.txt
  21. README.md
README.md

Vulkan Ecosystem Components

This project provides the Khronos official Vulkan validation layers for Windows, Linux, Android, and MacOS.

CI Build Status

PlatformBuild Status
Linux/AndroidBuild Status
WindowsBuild status

Introduction

Vulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. This project provides Vulkan validation layers that can be enabled to assist development by enabling developers to verify their applications correct use of the Vulkan API.

The following components are available in this repository:

Contact Information

Information for Developing or Contributing:

Please see the CONTRIBUTING.md file in this repository for more details. Please see the GOVERNANCE.md file in this repository for repository management details.

How to Build and Run

BUILD.md Includes directions for building all components as well as running validation tests.

Information on how to enable the various Validation layers is in layers/README.md.

License

This work is released as open source under a Apache-style license from Khronos including a Khronos copyright.

See COPYRIGHT.txt for a full list of licenses used in this repository.

Acknowledgements

While this project has been developed primarily by LunarG, Inc., there are many other companies and individuals making this possible: Valve Corporation, funding project development; Google providing significant contributions to the validation layers; Khronos providing oversight and hosting of the project.