Skip to content

Commit

Permalink
Try to "make" the python extension during compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Marchent committed Jan 16, 2019
1 parent d01cf6b commit 13402c3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions folly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ install(

add_subdirectory(experimental/exception_tracer)

get_target_property(pic folly POSITION_INDEPENDENT_CODE)
if (pic AND CYTHON_FOUND AND PYTHONINTERP_FOUND)
if (CYTHON_FOUND AND PYTHONINTERP_FOUND)
# Create tree of symbolic links in structure required for successful
# compliation by Cython.
# - must be in path named same as extension
Expand All @@ -34,10 +33,14 @@ if (pic AND CYTHON_FOUND AND PYTHONINTERP_FOUND)
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/python/${_src} "${_cybld}/folly/${_src}")
endforeach()

add_custom_target(folly_python_bindings ALL
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build_ext -f
WORKING_DIRECTORY ${_cybld})

# Install Folly Python Bindings
install(CODE "
string(REGEX REPLACE \"^(..*)$\" \"--root=\\\\1\" PYROOT \"\$ENV{DESTDIR}\")
execute_process(COMMAND
python3 ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build_ext -f install \${PYROOT}
python3 ${CMAKE_CURRENT_SOURCE_DIR}/setup.py install \${PYROOT}
WORKING_DIRECTORY ${_cybld})")
endif ()

0 comments on commit 13402c3

Please sign in to comment.