Set VK_NO_PROTOTYPES on test targets
authorCharles Giessen <charles@lunarg.com>
Wed, 9 Mar 2022 21:48:50 +0000 (14:48 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Wed, 9 Mar 2022 22:06:30 +0000 (15:06 -0700)
Moves the definition of VK_NO_PROTOTYPES out of a header and into cmake so that
so that libraries and executables can set or not set it if they so desire. This
allows binaries to link directly to the loader if need be.

tests/CMakeLists.txt
tests/framework/CMakeLists.txt

index 22104474cea22c6897fbf1ee84107961d46e9f36..6b9c494d6925dde16ee7acdbc1a55876620d925e 100644 (file)
@@ -41,6 +41,7 @@ add_executable(
         loader_wsi_tests.cpp)
 target_link_libraries(test_regression PUBLIC testing_dependencies)
 set_target_properties(test_regression ${LOADER_STANDARD_CXX_PROPERTIES})
+target_compile_definitions(test_regression PUBLIC VK_NO_PROTOTYPES)
 
 add_executable(
     test_threading
@@ -48,6 +49,7 @@ add_executable(
         loader_threading_tests.cpp)
 target_link_libraries(test_threading PUBLIC testing_dependencies)
 set_target_properties(test_threading ${LOADER_STANDARD_CXX_PROPERTIES})
+target_compile_definitions(test_threading PUBLIC VK_NO_PROTOTYPES)
 
 # executables that are meant for testing against real drivers rather than the mocks
 if (ENABLE_LIVE_VERIFICATION_TESTS)
index a49159ba8804fbb32bc2984aff367903a5ec20f1..d11f797d6965d07b5090c9be7d9537a9ec9d2b99 100644 (file)
@@ -53,7 +53,7 @@ function(AddSharedLibrary LIBRARY_NAME)
 
     add_library(${LIBRARY_NAME} SHARED ${PARSED_ARGS_SOURCES})
     target_link_libraries(${LIBRARY_NAME} PUBLIC testing_framework_util)
-    target_compile_definitions(${LIBRARY_NAME} PRIVATE ${PARSED_ARGS_DEFINITIONS})
+    target_compile_definitions(${LIBRARY_NAME} PRIVATE ${PARSED_ARGS_DEFINITIONS} VK_NO_PROTOTYPES)
     set_target_properties(${LIBRARY_NAME} ${LOADER_STANDARD_CXX_PROPERTIES})
     # Windows requires export definitions for these libraries
     if(WIN32)