From edbd2654e883ee9e20b61621e06bcc65d6508fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 19 Jun 2015 01:25:12 +0100 Subject: [PATCH] cmake & files --- packages/gecode/CMakeLists.txt | 10 ++++----- packages/gecode/gecode3_yap.cc | 5 ++--- packages/gecode/gecode4_yap.cc | 38 ++++++++++++++-------------------- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/packages/gecode/CMakeLists.txt b/packages/gecode/CMakeLists.txt index c08845f86..8c1959d6c 100644 --- a/packages/gecode/CMakeLists.txt +++ b/packages/gecode/CMakeLists.txt @@ -26,7 +26,7 @@ if (GECODE_FOUND) disjunctor.icc disjunctor.hh ) - add_custom_target (gecodeyap ALL DEPENDS gecode${GECODE_MAJOR}_yap_hand_written.yap ${GECODE_VERSION}/gecode_yap_auto_generated.yap gecode + add_custom_target (gecodeyap ALL DEPENDS gecode${GECODE_MAJOR}_yap_hand_written.yap ${GECODE_VERSION}/gecode_yap_auto_generated.yap gecode_yap ) # WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) # create a startup.yss on the top directory. @@ -36,15 +36,15 @@ if (GECODE_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - add_library (gecode SHARED ${GECODE_SOURCES}) + add_library (gecode_yap SHARED ${GECODE_SOURCES}) - target_link_libraries(gecode libYap ${GECODE_LIBRARIES}) + target_link_libraries(gecode_yap libYap ${GECODE_LIBRARIES}) - set_target_properties (gecode PROPERTIES PREFIX "") + set_target_properties (gecode_yap PROPERTIES PREFIX "") include_directories (${GECODE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${GECODE_VERSION}) - install(TARGETS gecode + install(TARGETS gecode_yap LIBRARY DESTINATION ${dlls} ) diff --git a/packages/gecode/gecode3_yap.cc b/packages/gecode/gecode3_yap.cc index 9cd3c67a8..30cbfdaf0 100644 --- a/packages/gecode/gecode3_yap.cc +++ b/packages/gecode/gecode3_yap.cc @@ -76,10 +76,9 @@ extern "C" static int gecode_space_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } diff --git a/packages/gecode/gecode4_yap.cc b/packages/gecode/gecode4_yap.cc index 74b59887f..a8871531f 100644 --- a/packages/gecode/gecode4_yap.cc +++ b/packages/gecode/gecode4_yap.cc @@ -24,6 +24,8 @@ using namespace Gecode; extern "C" { +void gecode_init(void); + #include "config.h" } @@ -62,7 +64,6 @@ namespace generic_gecode extern "C" { -#include "SWI-Stream.h" #include "YapInterface.h" static YAP_opaque_tag_t gecode_space_tag; @@ -76,10 +77,9 @@ extern "C" static YAP_Bool gecode_space_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } @@ -565,10 +565,9 @@ extern "C" static YAP_Bool gecode_engine_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } @@ -597,10 +596,9 @@ extern "C" static YAP_Bool gecode_disjunctor_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } @@ -616,10 +614,9 @@ extern "C" static YAP_Bool gecode_clause_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream_, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } @@ -1553,10 +1550,9 @@ extern "C" static YAP_Bool gecode_reify_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } @@ -1591,10 +1587,9 @@ extern "C" static YAP_Bool gecode_tupleset_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; } @@ -1640,10 +1635,9 @@ extern "C" static YAP_Bool gecode_dfa_write_handler - (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + (FILE *stream, YAP_opaque_tag_t type, void *p, int flags) { - IOSTREAM* stream = (IOSTREAM*) stream_; - Sfprintf(stream,"", p); + fprintf(stream,"", p); return TRUE; }