Skip to content

Commit

Permalink
Fix SDK regression
Browse files Browse the repository at this point in the history
Currently UNIX platforms like linux/mac default to using package
config and don't use CMake config.

This broke our existing SDK process for jsoncpp
  • Loading branch information
juan-lunarg authored and johnzupin committed Dec 14, 2023
1 parent c064fc9 commit 4337a84
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions via/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,24 @@ elseif (MSVC)
target_compile_definitions(vkvia PRIVATE _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES)
endif()

# https://github.com/LunarG/VulkanTools/issues/1908
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp)
target_link_libraries(vkvia PRIVATE PkgConfig::jsoncpp)
else()
find_package(jsoncpp CONFIG REQUIRED)
# NOTE: jsoncpp hasn't had updates in a bit and isn't getting fixes.
# may be worth using nlohmann/json in the future which gets more updates
# and has better CMake support.
find_package(jsoncpp CONFIG)
if (TARGET jsoncpp_static)
target_link_libraries(vkvia PRIVATE jsoncpp_static)

# Support using jsoncpp.pc but only for UNIX platforms.
# And only if UPDATE_DEPS is disabled.
elseif (UNIX AND NOT UPDATE_DEPS)

# https://github.com/LunarG/VulkanTools/issues/1908
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp)
target_link_libraries(vkvia PRIVATE PkgConfig::jsoncpp)
endif()

endif()

target_link_libraries(vkvia PRIVATE
Expand Down

0 comments on commit 4337a84

Please sign in to comment.