blob: 0006d87dc9fdf8b5d1132ba7c0d0f5fe7c1604c6 [file] [log] [blame]
Jon Ashburnd43f9b62014-10-14 19:15:22 -06001include_directories(
2 ${CMAKE_CURRENT_SOURCE_DIR}
Chia-I Wu38e5a2c2015-01-04 11:12:47 +08003 ${CMAKE_CURRENT_BINARY_DIR}
Jon Ashburnd43f9b62014-10-14 19:15:22 -06004)
Chia-I Wu0c105342014-08-03 09:31:26 +08005
Courtney Goeltzenleuchterba7133b2015-02-10 18:40:14 -07006# DEBUG enables runtime loader ICD verification
7set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
8set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
Mark Lobodzinski953a1692015-01-09 15:12:03 -06009
Ian Elliott81ac44c2015-01-13 17:52:38 -070010if (WIN32)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060011 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES -D_CRT_SECURE_NO_WARNINGS -DXCB_NVIDIA")
Ian Elliott64f74a82015-02-04 12:06:46 -070012
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060013 add_library(vulkan SHARED loader.c loader.h loader_platform.h dirent_on_windows.c trampoline.c wsi_lunarg.c wsi_lunarg.h debug_report.c debug_report.h table_ops.h gpa_helper.h vulkan.def)
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -060014 set_target_properties(vulkan PROPERTIES LINK_FLAGS "/DEF:${PROJECT_SOURCE_DIR}/loader/vulkan.def")
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060015 add_library(VKstatic STATIC loader.c loader.h dirent_on_windows.c trampoline.c wsi_lunarg.c wsi_lunarg.h debug_report.c debug_report.h table_ops.h gpa_helper.h)
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -060016 set_target_properties(VKstatic PROPERTIES OUTPUT_NAME VKstatic)
17 target_link_libraries(vulkan)
Ian Elliott81ac44c2015-01-13 17:52:38 -070018endif()
19if (NOT WIN32)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060020 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES -Wpointer-arith")
Ian Elliott64f74a82015-02-04 12:06:46 -070021
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060022 add_library(vulkan SHARED loader.c trampoline.c wsi_lunarg.c wsi_lunarg.h debug_report.c debug_report.h loader.h loader_platform.h table_ops.h gpa_helper.h)
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -060023 set_target_properties(vulkan PROPERTIES SOVERSION 0)
24 target_link_libraries(vulkan -ldl -lpthread)
Ian Elliott81ac44c2015-01-13 17:52:38 -070025endif()