[waffle] [PATCH] cmake: Fix dependency on cmocka

Paul Berry stereotype441 at gmail.com
Mon Dec 2 14:53:01 PST 2013


On 2 December 2013 14:46, Chad Versace <chad.versace at linux.intel.com> wrote:

> This fixes an error in the Makefile-dependency of unittests, introduced
> in commit ad40427a864a7436953b319fbfdb2c04ccb7bdab.
>
> From the perspective of Waffle's CMake, libcmocka.so is an *imported*
> library. In other words, it's a virtual target, represented by
> a '.PHONY' target in Unix Makefiles.
>
> To guarantee that libcmocka.so gets built, CMake must declare that the
> .PHONY 'cmocka' target depends on another .PHONY target, which does the
> actual building. Making 'cmocka' depend on a non-PHONY target doesn't
> work.
>
> Reported-by: Shazia Rahman <srahman at nvidia.com>
> Reported-by: Paul Berry <stereotype441 at gmail.com>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
>

That fixes the problem for me, thanks!

Tested-by: Paul Berry <stereotype441 at gmail.com>


> ---
>  cmake/Modules/WaffleCMocka.cmake | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmake/Modules/WaffleCMocka.cmake
> b/cmake/Modules/WaffleCMocka.cmake
> index 635c31a..e276acd 100644
> --- a/cmake/Modules/WaffleCMocka.cmake
> +++ b/cmake/Modules/WaffleCMocka.cmake
> @@ -43,7 +43,7 @@ set_target_properties(cmocka
>      PROPERTIES
>          IMPORTED_LOCATION ${cmocka_library_location}
>  )
> -add_dependencies(cmocka ${cmocka_library_location})
> +add_dependencies(cmocka cmocka-build)
>  add_custom_command(
>      OUTPUT ${cmocka_library_location}
>      WORKING_DIRECTORY ${cmocka_build_dir}
> --
> 1.8.3.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20131202/4e6ae731/attachment-0001.html>


More information about the waffle mailing list