python fixes for win32

This commit is contained in:
Vitor Santos Costa
2017-06-13 13:34:17 +01:00
parent bba62ea6eb
commit d06dd49dd0
10 changed files with 130 additions and 108 deletions

View File

@@ -3,20 +3,22 @@
set (PYTHON_SOURCES python.c pl2py.c pybips.c py2pl.c pl2pl.c pypreds.c)
set (PYTHON_HEADERS python.h)
set (PYTHON_HEADERS py4yap.h)
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
add_library (YAPPython0 OBJECT ${PYTHON_SOURCES})
include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include )
add_library (Obj4Py OBJECT ${PYTHON_SOURCES} ${PYTHON_HEADERS})
if (WIN32)
add_library (YAPPython SHARED pyload.c )
add_library (YAPPython SHARED pyload.c ${PYTHON_HEADERS} )
endif()
# arithmetic hassle.
set_property(TARGET YAPPython PROPERTY CXX_STANDARD 11)
set_property(TARGET YAPPython PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(YAPPython libYap ${PYTHON_LIBRARY})
target_link_libraries(YAPPython libYap ${PYTHON_LIBRARIES})
set_property( SOURCE ${PYTHON_SOURCES} APPEND PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 _GNU-SOURCE=1)