From 0dd63f633a9c91ecdd1dfe1489ac1b0a66d867b9 Mon Sep 17 00:00:00 2001 From: kaarrot <8253037+kaarrot@users.noreply.github.com> Date: Fri, 12 Apr 2024 12:51:38 -0700 Subject: [PATCH] build: fix missing target_link_options for libraries It seems that two targets `libOpenImageIO`, `libOpenImageIO_Util` were left out during the [switch to target-based definitions] (https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4193) refactor and have no `-ftest-coverage -fprofile-arcs` options added in the CODECOV=1 mode. This was due to #4193 failing to propagate the link options to the dynamic libraries. Adding the missing options resolves build errors. Signed-off-by: kuba --- src/libOpenImageIO/CMakeLists.txt | 2 ++ src/libutil/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt index ea12b422f9..c27761e172 100644 --- a/src/libOpenImageIO/CMakeLists.txt +++ b/src/libOpenImageIO/CMakeLists.txt @@ -82,6 +82,8 @@ target_compile_definitions(OpenImageIO PRIVATE ${${PROJECT_NAME}_compile_definitions}) target_compile_options(OpenImageIO PRIVATE ${${PROJECT_NAME}_compile_options}) +target_link_options(OpenImageIO PRIVATE + ${${PROJECT_NAME}_link_options}) # If the 'EMBEDPLUGINS' option is set, we want to compile the source for # all the plugins into libOpenImageIO. diff --git a/src/libutil/CMakeLists.txt b/src/libutil/CMakeLists.txt index bce86d8b55..063b4b7665 100644 --- a/src/libutil/CMakeLists.txt +++ b/src/libutil/CMakeLists.txt @@ -42,6 +42,9 @@ function (setup_oiio_util_library targetname) ${${PROJECT_NAME}_compile_definitions}) target_compile_options(${targetname} PRIVATE ${${PROJECT_NAME}_compile_options}) + target_link_options(${targetname} PRIVATE + ${${PROJECT_NAME}_link_options}) + target_include_directories (${targetname} PUBLIC $