Skip to content

Commit

Permalink
Revert "Changes that suggested on #770" and Added way given on pull req.
Browse files Browse the repository at this point in the history
This reverts commit d4afa9e partially.

as @jdemel stated:
> CMAKE_CURRENT_BINARY_DIR would possibly be the preferred way to use. I'd suspect changing this variable in the original location would already fix your issue. That'd be great. That way we can keep the code in a more generic place that makes it easier to re-use. Also, thanks for your patience. 

I changed code with stated expression, and boom. it worked.
  • Loading branch information
Zaryob committed Sep 25, 2024
1 parent d4afa9e commit 734e0ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
15 changes: 14 additions & 1 deletion cmake/Modules/VolkPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)
# Usage: VOLK_UNIQUE_TARGET(<description> <dependencies list>)
########################################################################
function(VOLK_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
file(RELATIVE_PATH reldir ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
unique = hashlib.sha256(b'${reldir}${ARGN}').hexdigest()[:5]
Expand Down Expand Up @@ -259,3 +259,16 @@ function(VOLK_PYTHON_INSTALL)
volk_unique_target("pygen" ${python_install_gen_targets})

endfunction(VOLK_PYTHON_INSTALL)

########################################################################
# Write the python helper script that generates byte code files
########################################################################
file(
WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py
"
import sys, py_compile
files = sys.argv[1:]
srcs, gens = files[:len(files)//2], files[len(files)//2:]
for src, gen in zip(srcs, gens):
py_compile.compile(file=src, cfile=gen, doraise=True)
")
13 changes: 0 additions & 13 deletions python/volk_modtool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
#

########################################################################
# Write the python helper script that generates byte code files
########################################################################
file(
WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py
"
import sys, py_compile
files = sys.argv[1:]
srcs, gens = files[:len(files)//2], files[len(files)//2:]
for src, gen in zip(srcs, gens):
py_compile.compile(file=src, cfile=gen, doraise=True)
")

########################################################################
# Install python files and apps
########################################################################
Expand Down

0 comments on commit 734e0ec

Please sign in to comment.