aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricio Vásquez <mauriciovasquezbernal@gmail.com>2018-09-27 00:15:34 -0500
committeryonghong-song <ys114321@gmail.com>2018-09-26 22:15:34 -0700
commitf138fea5a9ab279b7347fa6acfd2f53777068b27 (patch)
tree80954a0952aabc68ed3e03959721fd231aa1d79c
parent27e7aeab5d7b9f0f4259fb0f996274af0521243f (diff)
downloadbcc-f138fea5a9ab279b7347fa6acfd2f53777068b27.zip
bcc-f138fea5a9ab279b7347fa6acfd2f53777068b27.tar.gz
bcc-f138fea5a9ab279b7347fa6acfd2f53777068b27.tar.bz2
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: Mauricio Vasquez B <mauriciovasquezbernal@gmail.com>
-rw-r--r--src/python/CMakeLists.txt8
-rwxr-xr-xtests/wrapper.sh.in2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index 3b9c7f8..7ce8366 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -1,11 +1,11 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
-macro(symlink_file SRC DST)
- execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC} ${DST})
-endmacro()
+set(PYTHON_SRC __init__.py perf.py tcp.py utils.py libbcc.py table.py usdt.py)
-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)
set(PYTHON_CMD "python")
diff --git a/tests/wrapper.sh.in b/tests/wrapper.sh.in
index 49d49be..90b63ec 100755
--- a/tests/wrapper.sh.in
+++ b/tests/wrapper.sh.in
@@ -8,7 +8,7 @@ name=$1; shift
kind=$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
ns=$name