This commit is contained in:
Vitor Santos Costa 2019-01-09 13:59:58 +00:00
parent 6451328782
commit 29c004d62a
9 changed files with 66 additions and 65 deletions

View File

@ -83,8 +83,9 @@ endif ()
## options: libraries ## options: libraries
option(WITH_THREADED_CODE "threaded code" ON) option(WITH_THREADED_CODE "threaded code" ON)
if (NOT ANDROID)
option(WITH_MPI "Interface to OpenMPI/MPICH" ON) option(WITH_MPI "Interface to OpenMPI/MPICH" ON)
option(WITH_READLINE "use readline or libedit" ON) endif()
option(WITH_JIT "just in Time Clause Compilation" OFF) option(WITH_JIT "just in Time Clause Compilation" OFF)
if (APPLE) if (APPLE)
@ -539,6 +540,7 @@ endif (HAVE_GCC)
# #
#option (YAP_SWI_IO ON) #option (YAP_SWI_IO ON)
#TODO:
#TODO: #TODO:
if (WITH_CALL_TRACER) if (WITH_CALL_TRACER)
list(APPEND YAP_SYSTEM_OPTIONS "call_tracer " ${YAP_SYSTEM_OPTIONS}) list(APPEND YAP_SYSTEM_OPTIONS "call_tracer " ${YAP_SYSTEM_OPTIONS})
@ -560,6 +562,47 @@ IF (WITH_R)
add_subDIRECTORY(packages/real) add_subDIRECTORY(packages/real)
ENDIF (WITH_R) ENDIF (WITH_R)
include(Sources)
ADD_SUBDIRECTORY(OPTYap)
ADD_SUBDIRECTORY(os)
ADD_SUBDIRECTORY(library/dialect/swi/fli)
ADD_SUBDIRECTORY(CXX)
add_subDIRECTORY(utf8proc )
if(ANDROID)
set(CXX_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/packages/swig/android)
add_subdirectory(packages/swig/android)
add_definitions(-DMYDDAS=1 -DEMBEDDED_MYDDAS=1 -DMYDDAS_SQLITE3=1 -DEMBEDDED_SQLITE3=1)
link_directories(${CMAKE_SOURCE_DIR}/../sqlite-android/jni/${CMAKE_ANDROID_ARCH_ABI})
else()
add_definitions(-DMYDDAS=1 -DEMBEDDED_MYDDAS=1 -DMYDDAS_SQLITE3=1 )
endif()
if (MYSQL_FOUND)
add_definitions( -DMYDDAS_MYSQL=1)
endif ()
if (ODBC_FOUND)
add_definitions( -DMYDDAS_ODBC=1)
endif ()
if (POSTGRES_FOUND)
add_definitions( -DMYDDAS_POSTGRES=1)
endif()
#utf-8 is not aPconn option
# we use the nice UTF-8 package
#available at the Julia project
add_subDIRECTORY( packages/myddas )
List(APPEND YLIBS $<TARGET_OBJECTS:libOPTYap>) List(APPEND YLIBS $<TARGET_OBJECTS:libOPTYap>)
List(APPEND YLIBS $<TARGET_OBJECTS:libYAPOs>) List(APPEND YLIBS $<TARGET_OBJECTS:libYAPOs>)
List(APPEND YLIBS $<TARGET_OBJECTS:utf8proc>) List(APPEND YLIBS $<TARGET_OBJECTS:utf8proc>)
@ -572,47 +615,11 @@ if (WIN32 OR ANDROID)
endif () endif ()
if (ANDROID) if (ANDROID)
List(APPEND YLIBS $<TARGET_OBJECTS:YAPsqlite3>) List(APPEND YLIBS $<TARGET_OBJECTS:YAPsqlite3>)
List(APPEND YLIBS $<TARGET_OBJECTS:DROID>) List(APPEND YLIBS $<TARGET_OBJECTS:DROID>)
endif () endif ()
endif () endif ()
include(Sources)
if(ANDROID)
set(CXX_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/packages/swig/android)
add_subdirectory(packages/swig/android)
add_definitions(-DMYDDAS=1 -DEMBEDDED_MYDDAS=1 -DMYDDAS_SQLITE3=1 -DEMBEDDED_SQLITE3=1)
else()
add_definitions(-DMYDDAS=1 -DEMBEDDED_MYDDAS=1 -DMYDDAS_SQLITE3=1 )
endif()
if (WITH_MYSQL)
add_definitions( -DMYDDAS_MYSQL=1)
endif ()
if (WITH_ODBC)
add_definitions( -DMYDDAS_ODBC=1)
endif ()
if (WITH_POSTGRES)
add_definitions( -DMYDDAS_POSTGRES=1)
endif()
#utf-8 is not aPconn option
# we use the nice UTF-8 package
#available at the Julia project
ADD_SUBDIRECTORY(OPTYap)
ADD_SUBDIRECTORY(os)
ADD_SUBDIRECTORY(library/dialect/swi/fli)
ADD_SUBDIRECTORY(CXX)
add_subDIRECTORY(utf8proc )
add_subDIRECTORY( packages/myddas )
add_library( # Sets the name of the library. add_library( # Sets the name of the library.
libYap libYap
@ -637,7 +644,7 @@ if (READLINE_FOUND)
endif () endif ()
if (ANDROID) if (ANDROID)
target_link_libraries(libYap android log) target_link_libraries(libYap sqliteX android log)
endif() endif()
if (WIN32) if (WIN32)

View File

@ -29,18 +29,14 @@ set(MYDDAS_UTIL_SOURCES
myddas_util.c myddas_util.c
myddas_initialization.c) myddas_initialization.c)
set_property(GLOBAL
APPEND PROPERTY
COMPILE_DEFINITIONS
-DMYDDAS=1)
add_subdirectory(sqlite3) add_subdirectory(sqlite3)
add_subdirectory(mysql) add_subdirectory(mysql)
add_subdirectory(odbc) add_subdirectory(odbc)
add_subdirectory(postgres) add_subdirectory(postgres)
set(CXX_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/packages/swig/android)
add_component(myddas add_component(myddas
${MYDDAS_SOURCES} ${MYDDAS_SOURCES}
${MYDDAS_UTIL_SOURCES} ${MYDDAS_UTIL_SOURCES}

View File

@ -1,7 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sqlite3.h>
#include "Yap.h" #include "Yap.h"
#include "myddas.h" #include "myddas.h"
#ifdef MYDDAS_STATS #ifdef MYDDAS_STATS

View File

@ -690,6 +690,8 @@ void init_myddas(void) {
return; return;
} }
#if MYDDAS #if MYDDAS
Yap_InitMYDDAS_SharedPreds();
Yap_InitBackMYDDAS_SharedPreds();
#define stringify(X) _stringify(X) #define stringify(X) _stringify(X)
#define _stringify(X) #X #define _stringify(X) #X
Yap_REGS.MYDDAS_GLOBAL_POINTER = NULL; Yap_REGS.MYDDAS_GLOBAL_POINTER = NULL;

View File

@ -32,7 +32,7 @@ if (WITH_MYSQL)
LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR} LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR}
) )
endif() endif()
include_directories(${MYSQL_INCLUDE_DIR} ..) include_directories(${MYSQL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
set_target_properties(YAPmysql PROPERTIES set_target_properties(YAPmysql PROPERTIES
POSITION_INDEPENDENT_CODE ON POSITION_INDEPENDENT_CODE ON
PREFIX "" PREFIX ""

View File

@ -15,8 +15,6 @@
* * * *
*************************************************************************/ *************************************************************************/
:- load_foreign_files([myddas], [], init_myddas).
#ifdef DEBUG #ifdef DEBUG
:- yap_flag(single_var_warnings,on). :- yap_flag(single_var_warnings,on).
:- yap_flag(write_strings,on). :- yap_flag(write_strings,on).
@ -112,6 +110,8 @@
]). ]).
:- load_foreign_files([myddas], [], init_myddas).
/* Initialize MYDDAS GLOBAL STRUCTURES */ /* Initialize MYDDAS GLOBAL STRUCTURES */
:- c_db_initialize_myddas. :- c_db_initialize_myddas.

View File

@ -1,7 +1,6 @@
if (MYDDAS_SQLITE3)
# message( " * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS" )
if (WITH_SQLITE3)
set (SQLITE_TEST set (SQLITE_TEST
sqlitest.yap) sqlitest.yap)
@ -9,10 +8,10 @@ if (MYDDAS_SQLITE3)
set( YAPSQLITE3_SOURCES set( YAPSQLITE3_SOURCES
myddas_sqlite3.c myddas_sqlite3.c
src/sqlite3.h
src/sqlite3ext.h
) )
message( " * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS" )
add_to_dir(SQLITE_DB ${YAP_INSTALL_DATADIR}) add_to_dir(SQLITE_DB ${YAP_INSTALL_DATADIR})
add_to_dir( SQLITE_TEST ${YAP_INSTALL_DATADIR}) add_to_dir( SQLITE_TEST ${YAP_INSTALL_DATADIR})
@ -23,13 +22,9 @@ if (MYDDAS_SQLITE3)
set_property(DIRECTORY set_property(DIRECTORY
APPEND PROPERTY APPEND PROPERTY
INCLUDE_DIRECTORIES ${ODBC_INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR} ) INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/src )
if (ANDROID)
add_definitions(-DSQLITE_FCNTL_MMAP_SIZE=0 )
endif()
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA=1 ) add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA=1 )
@ -42,15 +37,18 @@ set_property(DIRECTORY
SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 ) SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 )
message("ql ${EMBEDDED_SQLITE3}")
message( " * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS" )
if ( ANDROID )
add_definitions(-DSQLITE_FCNTL_MMAP_SIZE=0 )
list(APPEND YAPSQLITE3_SOURCES src/sqlite3.c) add_library( YAPsqlite3 OBJECT
if (XXANDROID )
add_library( YAPsqlite3 OBJECT
${YAPSQLITE3_SOURCES} ) ${YAPSQLITE3_SOURCES} )
else() else()
list(APPEND YAPSQLITE3_SOURCES src/sqlite3.c)
add_library( YAPsqlite3 SHARED add_library( YAPsqlite3 SHARED
${YAPSQLITE3_SOURCES}) ${YAPSQLITE3_SOURCES})

View File

@ -673,7 +673,6 @@ static void Yap_InitBackMYDDAS_SQLITE3Preds(void) {
X_API void init_sqlite3(void) { X_API void init_sqlite3(void) {
Term cm = CurrentModule; Term cm = CurrentModule;
CurrentModule = MkAtomTerm(Yap_LookupAtom("user"));
Yap_InitMYDDAS_SQLITE3Preds(); Yap_InitMYDDAS_SQLITE3Preds();

View File

@ -79,7 +79,7 @@ else ()
DEPENDS ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP} DEPENDS ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP}
) )
add_custom_command(OUTPUT ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP} add_custom_command(OUTPUT ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP}
COMMAND yap-bin -B COMMAND yap-bin -b
VERBATIM VERBATIM
DEPENDS ${PL_BOOT_SOURCES} yap-bin DEPENDS ${PL_BOOT_SOURCES} yap-bin
) )