Skip to content

Commit d8d293b

Browse files
committed
Added scl_memmgr to fedex_plus generated schema libraries.
1 parent 3be4220 commit d8d293b

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

data/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
5151
# multiple schemas, each one will use the include dirs from all previous schemas. Since
5252
# one header (schema.h) is always named the same, this will not work. only workaround
5353
# seems to be set_target_properties( <target> PROPERTIES COMPILE_FLAGS <flags> )
54-
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" )
54+
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" )
5555

5656
add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
5757
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
@@ -65,14 +65,15 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
6565
VERBATIM )
6666
if(MSVC OR BORLAND)
6767
add_definitions( -DSCL_SCHEMA_DLL_EXPORTS )
68+
add_definitions( -DSCL_BASE_DLL_IMPORTS )
6869
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
69-
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
70+
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
7071
add_definitions( -DSCL_DAI_DLL_IMPORTS )
7172
add_definitions( -DSCL_CORE_DLL_IMPORTS )
7273
add_definitions( -DSCL_EDITOR_DLL_IMPORTS )
7374
endif()
7475
add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} )
75-
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils )
76+
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils base )
7677
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
7778
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
7879
${${PROJECT_NAME}_COMPILE_FLAGS} )

src/fedex_plus/classes_wrapper.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ void print_file_header( Express express, FILES * files ) {
9090
files -> initall = FILEcreate( "schema.cc" );
9191
fprintf( files->initall, "\n// in the fedex_plus source code, this file is generally referred to as files->initall or schemainit\n" );
9292
fprintf( files->initall, "#include \"schema.h\"\n" );
93+
fprintf( files->initall, "#include \"scl_memmgr.h\"\n" );
9394
fprintf( files->initall, "class Registry;\n" );
9495

9596
fprintf( files->initall, "\nvoid SchemaInit (Registry & reg) {\n" );
@@ -103,6 +104,7 @@ void print_file_header( Express express, FILES * files ) {
103104
files -> create = FILEcreate( "SdaiAll.cc" );
104105
fprintf( files->create, "\n// in the fedex_plus source code, this file is generally referred to as files->create or createall\n" );
105106
fprintf( files->create, "#include \"schema.h\"\n" );
107+
fprintf( files->create, "#include \"scl_memmgr.h\"\n" );
106108
fprintf( files->create, "\nvoid InitSchemasAndEnts (Registry & reg) {\n" );
107109

108110
// 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
379381
fprintf( files->inc, "\n// in the fedex_plus source code, this file is generally referred to as files->inc or incfile\n" );
380382

381383
fprintf( incfile, "#include \"schema.h\"\n" );
384+
fprintf( incfile, "#include \"scl_memmgr.h\"\n" );
382385

383386
np = fnm + strlen( fnm ) - 1; /* point to end of constant part of string */
384387

@@ -397,6 +400,8 @@ void SCHEMAprint( Schema schema, FILES * files, Express model, void * complexCol
397400
#else
398401
fprintf( libfile, "#include \"schema.h\"\n" );
399402
#endif
403+
fprintf( libfile, "#include \"scl_memmgr.h\"\n" );
404+
400405
fprintf( libfile,
401406
"\n#ifdef SCL_LOGGING \n"
402407
"#include <fstream.h>\n"
@@ -444,6 +449,7 @@ void SCHEMAprint( Schema schema, FILES * files, Express model, void * complexCol
444449
"#endif\n" );
445450
#endif
446451
fprintf( initfile, "#include <Registry.h>\n#include <string>\n" );
452+
fprintf( initfile, "#include <scl_memmgr.h>\n" );
447453

448454
fprintf( initfile, "\nvoid %sInit (Registry& reg) {\n std::string str;\n", schnm );
449455

src/fedex_plus/write.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void writeheader( ostream & os, int noLists )
137137
<< " * file, however, there are no complex entities, so this\n"
138138
<< " * function is a stub.\n"
139139
<< " */" << endl << endl;
140-
os << "#include \"complexSupport.h\"\n\n";
140+
os << "#include \"complexSupport.h\"\n#include \"scl_memmgr.h\"\n\n";
141141
os << "ComplexCollect *gencomplex()" << endl;
142142
os << "{" << endl;
143143
return;
@@ -149,7 +149,7 @@ static void writeheader( ostream & os, int noLists )
149149
<< " * support structures. The structures will be used in the SCL to\n"
150150
<< " * validate user requests to instantiate complex entities.\n"
151151
<< " */" << endl << endl;
152-
os << "#include \"complexSupport.h\"\n\n";
152+
os << "#include \"complexSupport.h\"\n#include \"scl_memmgr.h\"\n\n";
153153
os << "ComplexCollect *gencomplex()" << endl;
154154
os << " /*" << endl
155155
<< " * This function contains instantiation statments for all the\n"

0 commit comments

Comments
 (0)