Skip to content

Commit

Permalink
[Fix] Fix manylinux pkg build issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
innerNULL committed Sep 3, 2021
1 parent e23d76d commit b09c416
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

option(BUILD_TESTS "Build tests" OFF)
option(BUILD_EXAMPLES "Build examples" ON)

execute_process(COMMAND bash -c "which python3" OUTPUT_VARIABLE PYTHON3_ENV)
if(NOT "${PYTHON3_ENV}" STREQUAL "")
string(REPLACE "\n" "" PYTHON3_ENV ""${PYTHON3_ENV})
Expand Down Expand Up @@ -70,11 +72,13 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
aux_source_directory(${PROJECT_SOURCE_DIR}/src LIB_SOURCE)
add_library(feather STATIC ${LIB_SOURCE})


add_executable(example "./example.cpp")
target_link_libraries(example PRIVATE feather)
target_link_libraries(example PRIVATE pybind11::module pybind11::lto pybind11::windows_extras pybind11::embed)
target_link_libraries(example PRIVATE absl::strings)
if (BUILD_EXAMPLES)
add_executable(example "./example.cpp")
target_link_libraries(example PRIVATE feather)
#target_link_libraries(example PRIVATE pybind11::module pybind11::lto pybind11::windows_extras pybind11::embed)
target_link_libraries(example PRIVATE pybind11::embed)
target_link_libraries(example PRIVATE absl::strings)
endif()

pybind11_add_module(pyfeather ${LIB_SOURCE})
target_link_libraries(pyfeather PRIVATE absl::strings)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def build_extension(self, ext):
"-DPYTHON_EXECUTABLE={}".format(sys.executable),
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm
"-DPYTHON_EXECUTABLE={}".format(PYTHON_ENV),
"-DBUILD_EXAMPLES=OFF",
]
build_args = []
# Adding CMake arguments set as environment variable
Expand Down
3 changes: 2 additions & 1 deletion test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ enable_testing()

add_executable(feather_tests test.cpp)
target_link_libraries(feather_tests PRIVATE feather)
target_link_libraries(feather_tests PRIVATE pybind11::module pybind11::lto pybind11::windows_extras pybind11::embed)
#target_link_libraries(feather_tests PRIVATE pybind11::module pybind11::lto pybind11::windows_extras pybind11::embed)
target_link_libraries(feather_tests PRIVATE pybind11::embed)
target_link_libraries(feather_tests PRIVATE absl::strings)
#target_link_libraries(feather_tests PRIVATE ${googletest})
target_link_libraries(feather_tests
Expand Down

0 comments on commit b09c416

Please sign in to comment.