Dwarves Archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Matteo Croce <mcroce@linux.microsoft.com>
Cc: dwarves@vger.kernel.org
Subject: Re: [PATCH] CMakeList.txt: make python optional
Date: Mon, 30 Aug 2021 15:57:44 -0300	[thread overview]
Message-ID: <YS0qKGpMfSYHRsUP@kernel.org> (raw)
In-Reply-To: <20210830150440.1525773-1-mcroce@linux.microsoft.com>

Em Mon, Aug 30, 2021 at 05:04:40PM +0200, Matteo Croce escreveu:
> From: Matteo Croce <mcroce@microsoft.com>
> 
> ostra-cg, which requires python, is installed in the destination dir.
> Make it optional for embedded distributions which doesn't have the
> python interpreter available.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Matteo Croce <mcroce@microsoft.com>
> ---
>  CMakeLists.txt | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 4140574..8523bce 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -61,6 +61,7 @@ find_package(DWARF REQUIRED)
>  find_package(ZLIB REQUIRED)
>  find_package(argp REQUIRED)
>  find_package(obstack REQUIRED)
> +find_package(Python3 QUIET)
>  
>  # make sure git submodule(s) are checked out
>  find_package(Git QUIET)
> @@ -185,8 +186,10 @@ install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h
>  	      elfcreator.h elf_symtab.h hash.h libctf.h
>  	DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/)
>  install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/)
> -install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +if(Python3_FOUND)
> +	install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +	install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python)
> +endif()
>  install(PROGRAMS btfdiff fullcircle DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> -install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python)
>  install(FILES lib/Makefile lib/ctracer_relay.c lib/ctracer_relay.h lib/linux.blacklist.cu
>  	DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime)
> -- 
> 2.31.1

-- 

- Arnaldo

      reply	other threads:[~2021-08-30 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 15:04 [PATCH] CMakeList.txt: make python optional Matteo Croce
2021-08-30 18:57 ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YS0qKGpMfSYHRsUP@kernel.org \
    --to=acme@kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=mcroce@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).