From 382d36b2d055f29234b77a5cdf3a7ff711f12b4c Mon Sep 17 00:00:00 2001 From: David Pinedo Date: Thu, 9 Jul 2015 12:44:38 -0600 Subject: [PATCH] Windows SDK: Rename vulkan.dll to vulkan..dll --- CMakeLists.txt | 12 ++++++++---- demos/CMakeLists.txt | 6 +++++- icd/CMakeLists.txt | 2 +- loader/CMakeLists.txt | 22 ++++++++++++++-------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 329bb27..7d30a4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,10 @@ cmake_minimum_required(VERSION 2.8.11) project (VULKAN) # set (CMAKE_VERBOSE_MAKEFILE 1) +# The MAJOR number of the version we're building, used in naming +# vulkan..dll (and other files). +set(MAJOR "0") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") # Header file for CMake settings @@ -42,16 +46,16 @@ else() set(PYTHON_CMD "py") endif() -option(BUILD_TESTS "Build tests" ON) +#option(BUILD_TESTS "Build tests" ON) # loader: Generic VULKAN ICD loader # icd: Device dependent (DD) VULKAN components # tests: VULKAN tests add_subdirectory(loader) add_subdirectory(icd) -if(BUILD_TESTS) - add_subdirectory(tests) -endif() +#if(BUILD_TESTS) +# add_subdirectory(tests) +#endif() add_subdirectory(layers) add_subdirectory(demos) #add_subdirectory(tools/glave) diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 11fd95e..f3f745f 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -19,7 +19,11 @@ file(COPY ${TEXTURES} DESTINATION ${CMAKE_BINARY_DIR}/demos) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES") -set (LIBRARIES "vulkan") +if(WIN32) + set (LIBRARIES "vulkan.${MAJOR}") +else () + set (LIBRARIES "vulkan") +endif() if(WIN32) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/tri-vert.spv diff --git a/icd/CMakeLists.txt b/icd/CMakeLists.txt index ecc2bb6..ddd542c 100644 --- a/icd/CMakeLists.txt +++ b/icd/CMakeLists.txt @@ -13,7 +13,7 @@ else() endif() add_subdirectory(common) -add_subdirectory(nulldrv) +#add_subdirectory(nulldrv) if (NOT WIN32) add_subdirectory(intel) endif() diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 51030c3..a02c71b 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -3,9 +3,15 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def - COMMAND ${PYTHON_CMD} ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py win-def-file vulkan all > ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def - DEPENDS ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py ${PROJECT_SOURCE_DIR}/vulkan.py) +if (WIN32) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vulkan.${MAJOR}.def + COMMAND ${PYTHON_CMD} ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py win-def-file vulkan.${MAJOR}.dll all > ${CMAKE_CURRENT_BINARY_DIR}/vulkan.${MAJOR}.def + DEPENDS ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py ${PROJECT_SOURCE_DIR}/vulkan.py) +else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def + COMMAND ${PYTHON_CMD} ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py win-def-file vulkan.dll all > ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def + DEPENDS ${PROJECT_SOURCE_DIR}/loader/vk-loader-generate.py ${PROJECT_SOURCE_DIR}/vulkan.py) +endif() # DEBUG enables runtime loader ICD verification set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") @@ -29,11 +35,11 @@ set(LOADER_SRCS if (WIN32) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES -D_CRT_SECURE_NO_WARNINGS") - add_library(vulkan SHARED ${LOADER_SRCS} dirent_on_windows.c ${CMAKE_CURRENT_BINARY_DIR}/vulkan.def) - set_target_properties(vulkan PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/vulkan.def") - add_library(VKstatic STATIC ${LOADER_SRCS} dirent_on_windows.c) - set_target_properties(VKstatic PROPERTIES OUTPUT_NAME VKstatic) - target_link_libraries(vulkan shlwapi) + add_library(vulkan.${MAJOR} SHARED ${LOADER_SRCS} dirent_on_windows.c ${CMAKE_CURRENT_BINARY_DIR}/vulkan.${MAJOR}.def) + set_target_properties(vulkan.${MAJOR} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/vulkan.${MAJOR}.def") + add_library(VKstatic.${MAJOR} STATIC ${LOADER_SRCS} dirent_on_windows.c) + set_target_properties(VKstatic.${MAJOR} PROPERTIES OUTPUT_NAME VKstatic.${MAJOR}) + target_link_libraries(vulkan.${MAJOR} shlwapi) endif() if (NOT WIN32) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES -Wpointer-arith") -- 2.7.4