mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-23 07:10:23 +00:00
Use targets CMake logic instead of directories
Replace the last usages of CMake logic that applied compiler definitions and options to the folder with usage of a target.
This commit is contained in:
parent
02c4578121
commit
fa7b4fde64
@ -27,9 +27,6 @@ set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM OFF)
|
||||
|
||||
project(Vulkan-Loader)
|
||||
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS API_NAME="Vulkan")
|
||||
|
||||
|
||||
if (UPDATE_DEPS)
|
||||
find_package(PythonInterp 3 REQUIRED)
|
||||
|
||||
@ -256,6 +253,7 @@ else()
|
||||
endif()
|
||||
|
||||
add_library(loader_common_options INTERFACE)
|
||||
target_compile_definitions(loader_common_options INTERFACE API_NAME="Vulkan")
|
||||
target_link_libraries(loader_common_options INTERFACE platform_wsi_defines)
|
||||
|
||||
# Enable beta Vulkan extensions
|
||||
@ -333,17 +331,17 @@ endif()
|
||||
|
||||
|
||||
if(UNIX)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS FALLBACK_CONFIG_DIRS="${FALLBACK_CONFIG_DIRS}" FALLBACK_DATA_DIRS="${FALLBACK_DATA_DIRS}")
|
||||
target_compile_definitions(loader_common_options INTERFACE FALLBACK_CONFIG_DIRS="${FALLBACK_CONFIG_DIRS}" FALLBACK_DATA_DIRS="${FALLBACK_DATA_DIRS}")
|
||||
|
||||
if(NOT (SYSCONFDIR STREQUAL ""))
|
||||
# SYSCONFDIR is specified, use it and do not force /etc.
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS SYSCONFDIR="${SYSCONFDIR}")
|
||||
target_compile_definitions(loader_common_options INTERFACE SYSCONFDIR="${SYSCONFDIR}")
|
||||
else()
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
||||
target_compile_definitions(loader_common_options INTERFACE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
||||
|
||||
# Make sure /etc is searched by the loader
|
||||
if(NOT (CMAKE_INSTALL_FULL_SYSCONFDIR STREQUAL "/etc"))
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS EXTRASYSCONFDIR="/etc")
|
||||
target_compile_definitions(loader_common_options INTERFACE EXTRASYSCONFDIR="/etc")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@ -200,7 +200,7 @@ else() # i.e.: Linux
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
|
||||
check_include_file("cet.h" HAVE_CET_H)
|
||||
if(HAVE_CET_H)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS HAVE_CET_H)
|
||||
target_compile_definitions(loader_specific_options INTERFACE HAVE_CET_H)
|
||||
endif()
|
||||
|
||||
try_compile(ASSEMBLER_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/asm_test_x86.S)
|
||||
|
Loading…
Reference in New Issue
Block a user