mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix python extension build on linux
This commit is contained in:
parent
8d9a4d5007
commit
251387660f
|
@ -19,19 +19,25 @@ pybind11_add_module(xlntpyarrowlib xlntpyarrow.lib.cpp)
|
||||||
set_target_properties(xlntpyarrowlib PROPERTIES
|
set_target_properties(xlntpyarrowlib PROPERTIES
|
||||||
OUTPUT_NAME "lib")
|
OUTPUT_NAME "lib")
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
target_compile_definitions(xlntpyarrowlib PRIVATE _CRT_SECURE_NO_WARNINGS=1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(xlntpyarrowlib
|
target_include_directories(xlntpyarrowlib
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../source
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../source
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../third-party/pybind11/include
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../third-party/pybind11/include
|
||||||
PRIVATE ${ARROW_INCLUDE_DIR})
|
PRIVATE ${ARROW_INCLUDE_DIR})
|
||||||
target_link_libraries(xlntpyarrowlib
|
target_link_libraries(xlntpyarrowlib
|
||||||
PRIVATE xlnt
|
PRIVATE xlnt)
|
||||||
PRIVATE ${ARROW_SHARED_IMP_LIB}
|
|
||||||
PRIVATE ${ARROW_PYTHON_SHARED_IMP_LIB})
|
if(MSVC)
|
||||||
|
target_compile_definitions(xlntpyarrowlib
|
||||||
|
PRIVATE _CRT_SECURE_NO_WARNINGS=1)
|
||||||
|
target_link_libraries(xlntpyarrowlib
|
||||||
|
PRIVATE ${ARROW_SHARED_IMP_LIB}
|
||||||
|
PRIVATE ${ARROW_PYTHON_SHARED_IMP_LIB})
|
||||||
|
else()
|
||||||
|
target_link_libraries(xlntpyarrowlib
|
||||||
|
PRIVATE ${ARROW_SHARED_LIB}
|
||||||
|
PRIVATE ${ARROW_PYTHON_SHARED_LIB})
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT STATIC)
|
if(NOT STATIC)
|
||||||
add_custom_command(TARGET xlntpyarrowlib POST_BUILD
|
add_custom_command(TARGET xlntpyarrowlib POST_BUILD
|
||||||
|
|
|
@ -145,7 +145,7 @@ class build_ext(_build_ext):
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
build_prefix = self.build_type
|
build_prefix = pjoin(['source'] + [self.build_type] if sys.platform == 'win32' else [])
|
||||||
|
|
||||||
def move_lib(lib_name):
|
def move_lib(lib_name):
|
||||||
lib_filename = (shared_library_prefix + lib_name +
|
lib_filename = (shared_library_prefix + lib_name +
|
||||||
|
@ -211,7 +211,7 @@ class build_ext(_build_ext):
|
||||||
return pjoin(head, self.build_type, tail + suffix)
|
return pjoin(head, self.build_type, tail + suffix)
|
||||||
else:
|
else:
|
||||||
suffix = sysconfig.get_config_var('SO')
|
suffix = sysconfig.get_config_var('SO')
|
||||||
return pjoin(self.build_type, name + suffix)
|
return name + suffix
|
||||||
|
|
||||||
def get_names(self):
|
def get_names(self):
|
||||||
return self._found_names
|
return self._found_names
|
||||||
|
|
Loading…
Reference in New Issue
Block a user