Commit f138fea5 authored by Mauricio Vásquez's avatar Mauricio Vásquez Committed by yonghong-song

Python build: copy files instead of creating link (#1989)

After https://github.com/iovisor/bcc/pull/1826 version.py is generated
by cmake in order to have the __version__ define in the module. The
previous approach of installing the python module created a link between the
src and the "build" folder, hence the version.py was actually created in the
scr folder, this caused some git noise.

This comit solves that problem by copying files instead of creating a link,
then the version.py file is only created in the "build" dir.
Signed-off-by: default avatarMauricio Vasquez B <mauriciovasquezbernal@gmail.com>
parent 27e7aeab
# Copyright (c) PLUMgrid, Inc. # Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License") # Licensed under the Apache License, Version 2.0 (the "License")
macro(symlink_file SRC DST) set(PYTHON_SRC __init__.py perf.py tcp.py utils.py libbcc.py table.py usdt.py)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC} ${DST})
endmacro()
symlink_file(${CMAKE_CURRENT_SOURCE_DIR}/bcc ${CMAKE_CURRENT_BINARY_DIR}/bcc) foreach (PY_SRC ${PYTHON_SRC})
configure_file(bcc/${PY_SRC} ${CMAKE_CURRENT_BINARY_DIR}/bcc/${PY_SRC} COPYONLY)
endforeach()
if(NOT PYTHON_CMD) if(NOT PYTHON_CMD)
set(PYTHON_CMD "python") set(PYTHON_CMD "python")
......
...@@ -8,7 +8,7 @@ name=$1; shift ...@@ -8,7 +8,7 @@ name=$1; shift
kind=$1; shift kind=$1; shift
cmd=$1; shift cmd=$1; shift
PYTHONPATH=@CMAKE_SOURCE_DIR@/src/python PYTHONPATH=@CMAKE_BINARY_DIR@/src/python
LD_LIBRARY_PATH=@CMAKE_BINARY_DIR@:@CMAKE_BINARY_DIR@/src/cc LD_LIBRARY_PATH=@CMAKE_BINARY_DIR@:@CMAKE_BINARY_DIR@/src/cc
ns=$name ns=$name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment