indenting + fix compilation
This commit is contained in:
parent
4cdbabfa69
commit
93bba89d52
1363
OPTYap/tab.tries.h
1363
OPTYap/tab.tries.h
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,11 @@
|
||||
SET( CMAKE_FIND_FRAMEWORK LAST)
|
||||
SET( CMAKE_FIND_APPBUNDLE LAST)
|
||||
|
||||
|
||||
# Be sure to also update these in Makefile!
|
||||
set(SO_MAJOR 1)
|
||||
set(SO_MINOR 0)
|
||||
set(SO_PATCH 0)
|
||||
|
||||
|
||||
set( MYDDAS_SOURCES
|
||||
myddas_initialization.c
|
||||
myddas_shared.c
|
||||
@ -15,6 +13,9 @@ set( MYDDAS_SOURCES
|
||||
myddas_top_level.c
|
||||
)
|
||||
|
||||
include_directories (. sqlite3)
|
||||
|
||||
|
||||
set( MYDDAS_HEADERS
|
||||
myddas.h
|
||||
myddas_statistics.h
|
||||
@ -27,66 +28,34 @@ set( MYDDAS_UTIL_SOURCES
|
||||
myddas_util.c
|
||||
myddas_initialization.c )
|
||||
|
||||
set_property( GLOBAL
|
||||
APPEND PROPERTY COMPILE_DEFINITIONS USE_MYDDAS=1)
|
||||
|
||||
# internal MYDDAS flag, used to preprocess ypp files.
|
||||
set (MYDDAS_FLAGS -DUSE_MYDDAS=1)
|
||||
|
||||
add_subdirectory (mysql)
|
||||
add_subdirectory (odbc)
|
||||
add_subdirectory (postgres)
|
||||
add_subdirectory (sqlite3)
|
||||
|
||||
set( MYDDAS_YPP
|
||||
pl/myddas.ypp
|
||||
pl/myddas_assert_predicates.ypp
|
||||
pl/myddas_top_level.ypp
|
||||
pl/myddas_errors.ypp
|
||||
pl/myddas_prolog2sql.ypp
|
||||
pl/myddas_util_predicates.ypp
|
||||
pl/myddas_prolog2sql_optimizer.ypp )
|
||||
|
||||
set( MYDDAS_PROLOG
|
||||
myddas.yap
|
||||
myddas_assert_predicates.yap
|
||||
myddas_top_level.yap
|
||||
myddas_errors.yap
|
||||
myddas_prolog2sql.yap
|
||||
myddas_util_predicates.yap
|
||||
myddas_prolog2sql_optimizer.yap )
|
||||
|
||||
function(cpp_compile filename)
|
||||
get_filename_component(base ${filename} NAME_WE)
|
||||
set(base_abs ${CMAKE_CURRENT_BINARY_DIR}/${base})
|
||||
set(output ${base_abs}.yap)
|
||||
add_custom_command(
|
||||
OUTPUT ${output}
|
||||
COMMAND ${CMAKE_C_COMPILER} -E ${CMAKE_C_FLAGS} -P -E -w -o ${CMAKE_CURRENT_BINARY_DIR} ${filename})
|
||||
set_source_files_properties(${output} PROPERTIES GENERATED TRUE)
|
||||
endfunction()
|
||||
|
||||
foreach(file ${MYDDAS_YPP})
|
||||
cpp_compile(GENERATED_SOURCES ${file})
|
||||
endforeach()
|
||||
|
||||
source_group("" FILES ${MYDDAS_YPP})
|
||||
source_group(generated FILES ${MYDDAS_YAP})
|
||||
|
||||
set_property( DIRECTORY ../..
|
||||
APPEND PROPERTY COMPILE_DEFINITIONS USE_MYDDAS=1)
|
||||
|
||||
Add_custom_target (plmyddas ALL DEPENDS ${MYDDAS_YAP} ) # WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
|
||||
add_subdirectory (pl)
|
||||
|
||||
|
||||
add_library (myddas OBJECT
|
||||
add_library (myddas OBJECT
|
||||
${MYDDAS_SOURCES}
|
||||
${MYDDAS_UTIL_SOURCES}
|
||||
${MYDDAS_HEADERS}
|
||||
)
|
||||
|
||||
|
||||
add_dependencies(myddas plmyddas)
|
||||
|
||||
set_target_properties (myddas PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
|
||||
|
||||
|
||||
cmake_dependent_option (USE_MYDDAS_Stats
|
||||
"enable the MYDDAS library statistics support" OFF
|
||||
USE_MYDDAS OFF)
|
||||
#TODO:
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "Yap.h"
|
||||
#include "cut_c.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "myddas.h"
|
||||
#include "myddas_util.h"
|
||||
|
||||
/* Type: MYSQL->1 ODBC->2*/
|
||||
Short myddas_util_connection_type(void *con) {
|
||||
int myddas_util_connection_type(void *con) {
|
||||
|
||||
MYDDAS_UTIL_CONNECTION con_node = myddas_util_search_connection(con);
|
||||
|
||||
@ -157,7 +157,7 @@ void myddas_util_set_total_multi_queries_number(MYDDAS_UTIL_CONNECTION con,
|
||||
con->total_number_queries = number;
|
||||
}
|
||||
|
||||
#ifdef MYDDAS_MYSQL
|
||||
#if defined(MYDDAS_MYSQL) && 0
|
||||
/* Auxilary function to table_write*/
|
||||
static void n_print(Int n, char c) {
|
||||
for (; n > 0; n--)
|
||||
|
@ -20,7 +20,8 @@ macro_log_feature (MYSQL_FOUND "MySQL"
|
||||
# MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
|
||||
# MYSQL_LIBRARIES - List of libraries when using MySQL.
|
||||
# MYSQL_FOUND - True if MySQL found.
|
||||
add_definitions (-DMYDDAS_MYSQL=1)
|
||||
set (MYDDAS_FLAGS ${MYDDAS_FLAGS} -DMYDDAS_MYSQL=1 PARENT_SCOPE)
|
||||
set_property( DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS MYDDAS_MYSQL=1 )
|
||||
add_library (Yapmysql SHARED ${YAPMYSQL_SOURCES})
|
||||
target_link_libraries(Yapmysql ${MYSQL_LIBRARIES} libYap)
|
||||
include_directories (${MYSQL_INCLUDE_DIR} ..)
|
||||
|
@ -17,7 +17,8 @@ if (ODBC_FOUND)
|
||||
# ODBC_INCLUDE_DIRECTORIES, where to find sql.h
|
||||
# ODBC_LIBRARIES, the libraries to link against to use ODBC
|
||||
# ODBC_FOUND. If false, you cannot build anything that requires Odbc.
|
||||
add_definitions (-DMYDDAS_ODBC=1)
|
||||
set (MYDDAS_FLAGS ${MYDDAS_FLAGS} -DMYDDAS_ODBC=1 PARENT_SCOPE)
|
||||
set_property( DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS MYDDAS_ODBC=1 )
|
||||
add_library (Yapodbc SHARED ${YAPODBC_SOURCES})
|
||||
target_link_libraries(Yapodbc libYap ${ODBC_LIBRARIES})
|
||||
include_directories (${ODBC_INCLUDE_DIRECTORIES} ..)
|
||||
|
@ -17,12 +17,6 @@
|
||||
|
||||
#if USE_MYDDAS
|
||||
|
||||
#ifndef __ANDROID__
|
||||
:- load_foreign_files([myddas], [], init_myddas).
|
||||
/* Initialize MYDDAS GLOBAL STRUCTURES */
|
||||
:- .
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
:- yap_flag(single_var_warnings,on).
|
||||
#endif
|
||||
|
@ -19,7 +19,9 @@ if (PostgreSQL_FOUND)
|
||||
# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
|
||||
# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
|
||||
add_library (Yappostgres SHARED ${YAPPOSTGRES_SOURCES})
|
||||
add_definitions (-DMYDDAS_POSTGRES=1)
|
||||
set (MYDDAS_FLAGS ${MYDDAS_FLAGS} -DMYDDAS_POSTGRES=1 PARENT_SCOPE)
|
||||
set_property( DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS MYDDAS_POSTGRES=1 )
|
||||
|
||||
target_link_libraries(Yappostgres libYap ${PostgreSQL_LIBRARIES})
|
||||
include_directories (${PostgreSQL_INCLUDE_DIRS} ..)
|
||||
set_target_properties (Yappostgres PROPERTIES
|
||||
@ -35,4 +37,3 @@ if (PostgreSQL_FOUND)
|
||||
else()
|
||||
add_definitions (-DMYDDAS_PostgreSQL=0)
|
||||
endif (PostgreSQL_FOUND)
|
||||
|
||||
|
@ -1,25 +1,44 @@
|
||||
|
||||
set( YAPSQLITE3_SOURCES
|
||||
myddas_sqlite3.c
|
||||
sqlite3.c
|
||||
sqlite3.h
|
||||
)
|
||||
|
||||
macro_optional_find_package(Sqlite3 ON)
|
||||
set( YAPSQLITE3_ANDROID_SOURCES
|
||||
Android/jni/sqlite/ALog-priv.h
|
||||
Android/jni/sqlite/JNIHelp.cpp
|
||||
Android/jni/sqlite/JniConstants.cpp
|
||||
Android/jni/sqlite/android_database_SQLiteCommon.cpp
|
||||
Android/jni/sqlite/android_database_SQLiteCommon.h
|
||||
Android/jni/sqlite/android_database_SQLiteConnection.cpp
|
||||
Android/jni/sqlite/android_database_SQLiteDebug.cpp
|
||||
Android/jni/sqlite/android_database_SQLiteGlobal.cpp
|
||||
Android/jni/sqlite/nativehelper/JNIHelp.h
|
||||
Android/jni/sqlite/nativehelper/JniConstants.h
|
||||
Android/jni/sqlite/nativehelper/ScopedLocalRef.h
|
||||
Android/jni/sqlite/nativehelper/jni.h
|
||||
)
|
||||
|
||||
#sqlite3 is now in the system
|
||||
|
||||
set (SQLITE3_FOUND ON PARENT_SCOPE)
|
||||
macro_log_feature (SQLITE3_FOUND "Sqlite3"
|
||||
"Sqlite3 Data-Base "
|
||||
"http://www.sqlite3ql.org" FALSE)
|
||||
|
||||
if (SQLITE3_FOUND)
|
||||
# SQLITE3_INCLUDE_DIRECTORIES, where to find sql.h
|
||||
# SQLITE3_LIBRARIES, the libraries to link against to use SQLITE3
|
||||
# SQLITE3_FOUND. If false, you cannot build anything that requires Sqlite3.
|
||||
add_library (Yapsqlite3 SHARED ${YAPSQLITE3_SOURCES})
|
||||
add_definitions (-DMYDDAS_SQLITE3=1)
|
||||
target_link_libraries(Yapsqlite3 ${SQLITE3_LIBRARIES} libYap)
|
||||
include_directories (${SQLITE3_INCLUDE_DIRECTORIES} .. )
|
||||
|
||||
include_directories (${SQLITE3_INCLUDE_DIRECTORIES} .. . Android/jni/sqlite Android/jni/sqlite/nativehelper)
|
||||
|
||||
set (MYDDAS_FLAGS ${MYDDAS_FLAGS} -DMYDDAS_SQLITE3=1 PARENT_SCOPE)
|
||||
set_property( DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS MYDDAS_SQLITE3=1 )
|
||||
|
||||
if (ANDROID)
|
||||
add_library (Yapsqlite3 OBJECT ${YAPSQLITE3_SOURCES} ${YAPSQLITE3_ANDROID_SOURCES})
|
||||
else()
|
||||
add_library (Yapsqlite3 SHARED ${YAPSQLITE3_SOURCES})
|
||||
target_link_libraries(Yapsqlite3 libYap)
|
||||
set_target_properties (Yapsqlite3 PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}"
|
||||
SOVERSION ${SO_MAJOR}
|
||||
)
|
||||
@ -28,5 +47,4 @@ if (SQLITE3_FOUND)
|
||||
LIBRARY DESTINATION ${libdir}
|
||||
ARCHIVE DESTINATION ${libdir}
|
||||
)
|
||||
|
||||
endif (SQLITE3_FOUND)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user