Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions generator/vk_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,21 @@
# SOFTWARE.
# -----------------------------------------------------------------------------

set(BUILD_TARGET lib_layer_framework)
set(LIB_BINARY lib_layer_framework)

add_library(
${BUILD_TARGET} STATIC
${LIB_BINARY} STATIC
device_functions.cpp
instance_functions.cpp)

target_include_directories(
${BUILD_TARGET} PRIVATE
${LIB_BINARY} PRIVATE
# Note, this includes from the layer-specific tree
${PROJECT_SOURCE_DIR}/source
../)

target_include_directories(
${BUILD_TARGET} SYSTEM PRIVATE
${LIB_BINARY} SYSTEM PRIVATE
../../khronos/vulkan/include)

lgl_set_build_options(${BUILD_TARGET})

# TODO: Log tag needs to come from child project
target_compile_definitions(
${BUILD_TARGET} PRIVATE
$<$<PLATFORM_ID:Android>:VK_USE_PLATFORM_ANDROID_KHR=1>
$<$<PLATFORM_ID:Android>:LGL_LOG_TAG="${LGL_LOG_TAG}">)

# TODO: Remove this?
target_link_libraries(
${BUILD_TARGET}
$<$<PLATFORM_ID:Android>:log>)
lgl_set_build_options(${LIB_BINARY})
14 changes: 11 additions & 3 deletions source_common/compiler_helper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ set(is_clangcl "$<AND:${is_msvc_fe},$<CXX_COMPILER_ID:Clang>>")
# Compiler is upstream clang with the standard frontend
set(is_clang "$<AND:${is_gnu_fe},$<CXX_COMPILER_ID:Clang,AppleClang>>")

# Utility macro to set standard compiler options
# Utility macro to set standard compiler and linker options
macro(lgl_set_build_options BUILD_TARGET_NAME)

# Layers are shared objects so must be position independent
set_property(
TARGET ${BUILD_TARGET_NAME}
PROPERTY POSITION_INDEPENDENT_CODE ON)

target_compile_options(
${BUILD_TARGET_NAME} PRIVATE
# Minimized visibility warnings
Expand All @@ -61,7 +66,10 @@ macro(lgl_set_build_options BUILD_TARGET_NAME)
$<${is_clang}:-Wdocumentation>

# Feature disabled
$<${is_gnu_fe}:-fno-exceptions>
$<${is_gnu_fe}:-fno-rtti>)
$<${is_gnu_fe}:-fno-exceptions>)

target_compile_definitions(
${BUILD_TARGET_NAME} PRIVATE
$<$<PLATFORM_ID:Android>:VK_USE_PLATFORM_ANDROID_KHR=1>
$<$<PLATFORM_ID:Android>:LGL_LOG_TAG="${LGL_LOG_TAG}">)
endmacro()
21 changes: 5 additions & 16 deletions source_common/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,21 @@
# SOFTWARE.
# -----------------------------------------------------------------------------

set(BUILD_TARGET lib_layer_framework)
set(LIB_BINARY lib_layer_framework)

add_library(
${BUILD_TARGET} STATIC
${LIB_BINARY} STATIC
device_functions.cpp
instance_functions.cpp)

target_include_directories(
${BUILD_TARGET} PRIVATE
${LIB_BINARY} PRIVATE
# Note, this includes from the layer-specific tree
${PROJECT_SOURCE_DIR}/source
../)

target_include_directories(
${BUILD_TARGET} SYSTEM PRIVATE
${LIB_BINARY} SYSTEM PRIVATE
../../khronos/vulkan/include)

lgl_set_build_options(${BUILD_TARGET})

# TODO: Log tag needs to come from child project
target_compile_definitions(
${BUILD_TARGET} PRIVATE
$<$<PLATFORM_ID:Android>:VK_USE_PLATFORM_ANDROID_KHR=1>
$<$<PLATFORM_ID:Android>:LGL_LOG_TAG="${LGL_LOG_TAG}">)

# TODO: Remove this?
target_link_libraries(
${BUILD_TARGET}
$<$<PLATFORM_ID:Android>:log>)
lgl_set_build_options(${LIB_BINARY})