diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 87c47b36..fd484801 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -51,7 +51,7 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE) # multiple schemas, each one will use the include dirs from all previous schemas. Since # one header (schema.h) is always named the same, this will not work. only workaround # seems to be set_target_properties( PROPERTIES COMPILE_FLAGS ) - set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore" ) + set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore -I${SCL_SOURCE_DIR}/src/base" ) add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} ) add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR} @@ -65,14 +65,15 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE) VERBATIM ) if(MSVC OR BORLAND) add_definitions( -DSCL_SCHEMA_DLL_EXPORTS ) + add_definitions( -DSCL_BASE_DLL_IMPORTS ) add_definitions( -DSCL_EXPRESS_DLL_IMPORTS ) - add_definitions( -DSCL_UTILS_DLL_IMPORTS ) + add_definitions( -DSCL_UTILS_DLL_IMPORTS ) add_definitions( -DSCL_DAI_DLL_IMPORTS ) add_definitions( -DSCL_CORE_DLL_IMPORTS ) add_definitions( -DSCL_EDITOR_DLL_IMPORTS ) endif() add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} ) - target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils ) + target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils base ) add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} ) set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${${PROJECT_NAME}_COMPILE_FLAGS} ) diff --git a/src/fedex_plus/classes_wrapper.cc b/src/fedex_plus/classes_wrapper.cc index 7189ccd5..2dccc1a6 100644 --- a/src/fedex_plus/classes_wrapper.cc +++ b/src/fedex_plus/classes_wrapper.cc @@ -90,6 +90,7 @@ void print_file_header( Express express, FILES * files ) { files -> initall = FILEcreate( "schema.cc" ); fprintf( files->initall, "\n// in the fedex_plus source code, this file is generally referred to as files->initall or schemainit\n" ); fprintf( files->initall, "#include \"schema.h\"\n" ); + fprintf( files->initall, "#include \"scl_memmgr.h\"\n" ); fprintf( files->initall, "class Registry;\n" ); fprintf( files->initall, "\nvoid SchemaInit (Registry & reg) {\n" ); @@ -103,6 +104,7 @@ void print_file_header( Express express, FILES * files ) { files -> create = FILEcreate( "SdaiAll.cc" ); fprintf( files->create, "\n// in the fedex_plus source code, this file is generally referred to as files->create or createall\n" ); fprintf( files->create, "#include \"schema.h\"\n" ); + fprintf( files->create, "#include \"scl_memmgr.h\"\n" ); fprintf( files->create, "\nvoid InitSchemasAndEnts (Registry & reg) {\n" ); // This file declares all entity classes as incomplete types. This will @@ -379,6 +381,7 @@ void SCHEMAprint( Schema schema, FILES * files, Express model, void * complexCol fprintf( files->inc, "\n// in the fedex_plus source code, this file is generally referred to as files->inc or incfile\n" ); fprintf( incfile, "#include \"schema.h\"\n" ); + fprintf( incfile, "#include \"scl_memmgr.h\"\n" ); np = fnm + strlen( fnm ) - 1; /* point to end of constant part of string */ @@ -397,6 +400,8 @@ void SCHEMAprint( Schema schema, FILES * files, Express model, void * complexCol #else fprintf( libfile, "#include \"schema.h\"\n" ); #endif + fprintf( libfile, "#include \"scl_memmgr.h\"\n" ); + fprintf( libfile, "\n#ifdef SCL_LOGGING \n" "#include \n" @@ -444,6 +449,7 @@ void SCHEMAprint( Schema schema, FILES * files, Express model, void * complexCol "#endif\n" ); #endif fprintf( initfile, "#include \n#include \n" ); + fprintf( initfile, "#include \n" ); fprintf( initfile, "\nvoid %sInit (Registry& reg) {\n std::string str;\n", schnm ); diff --git a/src/fedex_plus/write.cc b/src/fedex_plus/write.cc index 50837605..da36104c 100644 --- a/src/fedex_plus/write.cc +++ b/src/fedex_plus/write.cc @@ -137,7 +137,7 @@ static void writeheader( ostream & os, int noLists ) << " * file, however, there are no complex entities, so this\n" << " * function is a stub.\n" << " */" << endl << endl; - os << "#include \"complexSupport.h\"\n\n"; + os << "#include \"complexSupport.h\"\n#include \"scl_memmgr.h\"\n\n"; os << "ComplexCollect *gencomplex()" << endl; os << "{" << endl; return; @@ -149,7 +149,7 @@ static void writeheader( ostream & os, int noLists ) << " * support structures. The structures will be used in the SCL to\n" << " * validate user requests to instantiate complex entities.\n" << " */" << endl << endl; - os << "#include \"complexSupport.h\"\n\n"; + os << "#include \"complexSupport.h\"\n#include \"scl_memmgr.h\"\n\n"; os << "ComplexCollect *gencomplex()" << endl; os << " /*" << endl << " * This function contains instantiation statments for all the\n"