Jon Ashburn | d38bfb1 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 1 | include_directories( |
| 2 | ${CMAKE_CURRENT_SOURCE_DIR} |
Chia-I Wu | f46b81a | 2015-01-04 11:12:47 +0800 | [diff] [blame] | 3 | ${CMAKE_CURRENT_BINARY_DIR} |
Jon Ashburn | d38bfb1 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 4 | ) |
Chia-I Wu | 0c10534 | 2014-08-03 09:31:26 +0800 | [diff] [blame] | 5 | |
Tony Barbour | 1d825c7 | 2015-06-18 16:29:32 -0600 | [diff] [blame] | 6 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def |
| 7 | COMMAND ${PYTHON_CMD} ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py win-def-file vulkan all > ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def |
| 8 | DEPENDS ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py ${PROJECT_SOURCE_DIR}/vulkan.py) |
| 9 | |
Courtney Goeltzenleuchter | 64ca923 | 2015-02-10 18:40:14 -0700 | [diff] [blame] | 10 | # DEBUG enables runtime loader ICD verification |
| 11 | set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") |
| 12 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") |
Mark Lobodzinski | 391bb6d | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 13 | |
Jon Ashburn | 2077e38 | 2015-06-29 11:25:34 -0600 | [diff] [blame^] | 14 | set(LOADER_SRCS |
| 15 | loader.c |
| 16 | loader.h |
| 17 | loader_platform.h |
| 18 | trampoline.c |
| 19 | wsi_lunarg.c |
| 20 | wsi_lunarg.h |
| 21 | debug_report.c |
| 22 | debug_report.h |
| 23 | table_ops.h |
| 24 | gpa_helper.h |
| 25 | cJSON.c |
| 26 | cJSON.h |
| 27 | ) |
Ian Elliott | 1962880 | 2015-02-04 12:06:46 -0700 | [diff] [blame] | 28 | |
Jon Ashburn | 2077e38 | 2015-06-29 11:25:34 -0600 | [diff] [blame^] | 29 | if (WIN32) |
| 30 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES -D_CRT_SECURE_NO_WARNINGS") |
| 31 | |
| 32 | add_library(vulkan SHARED ${LOADER_SRCS} dirent_on_windows.c ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def) |
Tony Barbour | 1d825c7 | 2015-06-18 16:29:32 -0600 | [diff] [blame] | 33 | set_target_properties(vulkan PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/vulkan.def") |
Jon Ashburn | 2077e38 | 2015-06-29 11:25:34 -0600 | [diff] [blame^] | 34 | add_library(VKstatic STATIC ${LOADER_SRCS} dirent_on_windows.c) |
Courtney Goeltzenleuchter | f53c3cb | 2015-04-14 14:55:44 -0600 | [diff] [blame] | 35 | set_target_properties(VKstatic PROPERTIES OUTPUT_NAME VKstatic) |
| 36 | target_link_libraries(vulkan) |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 37 | endif() |
| 38 | if (NOT WIN32) |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 39 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES -Wpointer-arith") |
Ian Elliott | 1962880 | 2015-02-04 12:06:46 -0700 | [diff] [blame] | 40 | |
Jon Ashburn | 2077e38 | 2015-06-29 11:25:34 -0600 | [diff] [blame^] | 41 | add_library(vulkan SHARED ${LOADER_SRCS}) |
Courtney Goeltzenleuchter | f53c3cb | 2015-04-14 14:55:44 -0600 | [diff] [blame] | 42 | set_target_properties(vulkan PROPERTIES SOVERSION 0) |
| 43 | target_link_libraries(vulkan -ldl -lpthread) |
Ian Elliott | 2d4ab1e | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 44 | endif() |