From: Charles Giessen Date: Wed, 3 Nov 2021 20:38:54 +0000 (-0600) Subject: Refactor Windows specific loader CMake code X-Git-Tag: upstream/1.3.208~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab0fe52705ee2f37b102dd6cbe9c7a81fa2afa20;p=platform%2Fupstream%2FVulkan-Loader.git Refactor Windows specific loader CMake code Merged the loader-norm and vulkan libraries and moved the dirent_on_windows.c into the same block that adds loader_windows.c to the list of sources. This commit is a part of a series of commits and not intended to work standalone. --- diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index f867a9a1..66872f58 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -134,10 +134,10 @@ set(NORMAL_LOADER_SRCS ) if(WIN32) - set(NORMAL_LOADER_SRCS ${NORMAL_LOADER_SRCS} loader_windows.c) + list(APPEND NORMAL_LOADER_SRCS loader_windows.c dirent_on_windows.c) elseif(UNIX AND NOT APPLE) # i.e.: Linux - set(NORMAL_LOADER_SRCS ${NORMAL_LOADER_SRCS} loader_linux.c) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS LOADER_ENABLE_LINUX_SORT) + list(APPEND NORMAL_LOADER_SRCS loader_linux.c) + target_compile_definitions(loader_specific_options INTERFACE LOADER_ENABLE_LINUX_SORT) endif() set(OPT_LOADER_SRCS dev_ext_trampoline.c phys_dev_ext.c) @@ -237,12 +237,8 @@ else() # i.e.: Linux endif() if(WIN32) - add_library(loader-norm OBJECT ${NORMAL_LOADER_SRCS} dirent_on_windows.c) - # target_compile_options(loader-norm PUBLIC "$<$:${LOCAL_C_FLAGS_DBG}>") - target_compile_options(loader-norm PUBLIC ${MSVC_LOADER_COMPILE_OPTIONS}) - target_include_directories(loader-norm PRIVATE "$") - - add_library(loader-opt OBJECT ${OPT_LOADER_SRCS}) + add_library(loader-opt STATIC ${OPT_LOADER_SRCS}) + target_link_libraries(loader-opt PUBLIC loader_specific_options) add_dependencies(loader-opt loader_asm_gen_files) set_target_properties(loader-opt PROPERTIES CMAKE_C_FLAGS_DEBUG "${MODIFIED_C_FLAGS_DEBUG}") target_compile_options(loader-opt PUBLIC ${MSVC_LOADER_COMPILE_OPTIONS}) @@ -250,12 +246,15 @@ if(WIN32) add_library(vulkan SHARED - $ - $ + ${NORMAL_LOADER_SRCS} $ ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-1.def ${CMAKE_CURRENT_LIST_DIR}/loader.rc) + target_link_libraries(vulkan loader_specific_options loader-opt) + target_compile_options(vulkan PUBLIC ${MSVC_LOADER_COMPILE_OPTIONS}) + target_include_directories(vulkan PRIVATE "$") + if (UPDATE_DEPS) add_dependencies(vulkan vl_update_deps) endif()