1 cmake_minimum_required(VERSION 3.5)
3 if(NOT SCRIPT_API_SOURCE_FILE)
4 message(FATAL_ERROR "Script needs SCRIPT_API_SOURCE_FILE defined")
6 if(NOT SCRIPT_API_BINARY_FILE)
7 message(FATAL_ERROR "Script needs SCRIPT_API_BINARY_FILE defined")
9 if(NOT SCRIPT_API_FILE)
10 message(FATAL_ERROR "Script needs SCRIPT_API_FILE defined")
13 message(FATAL_ERROR "Script needs APIUC defined")
16 message(FATAL_ERROR "Script needs APILC defined")
19 macro(dump_fileheader)
20 get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME)
21 string(APPEND SQUIRREL_EXPORT "\n#include \"../${SCRIPT_API_FILE_NAME}\"")
22 if(NOT "${APIUC}" STREQUAL "Template")
23 string(REPLACE "script_" "template_" SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE_NAME}")
24 string(APPEND SQUIRREL_EXPORT "\n#include \"../template/${SCRIPT_API_FILE_NAME}.sq\"")
28 macro(dump_class_templates NAME)
29 string(REGEX REPLACE "^Script" "" REALNAME ${NAME})
31 string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} *> { static inline ${NAME} *Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; } };")
32 string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${NAME} &> { static inline ${NAME} &Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; } };")
33 string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} *> { static inline const ${NAME} *Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return (${NAME} *)instance; } };")
34 string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<const ${NAME} &> { static inline const ${NAME} &Get(HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, nullptr); return *(${NAME} *)instance; } };")
35 if("${NAME}" STREQUAL "ScriptEvent")
36 string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
37 elseif("${NAME}" STREQUAL "ScriptText")
38 string(APPEND SQUIRREL_EXPORT "\n")
39 string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<Text *> {")
40 string(APPEND SQUIRREL_EXPORT "\n static inline Text *Get(HSQUIRRELVM vm, int index) {")
41 string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_INSTANCE) {")
42 string(APPEND SQUIRREL_EXPORT "\n return Param<ScriptText *>::Get(vm, index);")
43 string(APPEND SQUIRREL_EXPORT "\n }")
44 string(APPEND SQUIRREL_EXPORT "\n if (sq_gettype(vm, index) == OT_STRING) {")
45 string(APPEND SQUIRREL_EXPORT "\n return new RawText(Param<const std::string &>::Get(vm, index));")
46 string(APPEND SQUIRREL_EXPORT "\n }")
47 string(APPEND SQUIRREL_EXPORT "\n return nullptr;")
48 string(APPEND SQUIRREL_EXPORT "\n }")
49 string(APPEND SQUIRREL_EXPORT "\n };")
51 string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${NAME} *> { static inline int Set(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; } };")
60 unset(ENUM_STRING_TO_ERRORS)
61 unset(ENUM_ERROR_TO_STRINGS)
65 unset(START_SQUIRREL_DEFINE_ON_NEXT_LINE)
72 file(STRINGS "${SCRIPT_API_FILE}" SOURCE_LINES)
76 if(NOT "${DOXYGEN_SKIP}" STREQUAL "")
77 message(FATAL_ERROR "${SCRIPT_API_FILE}:${NUM_LINE}: a DOXYGEN_API block was not properly closed")
81 foreach(LINE IN LISTS SOURCE_LINES)
82 math(EXPR NUM_LINE "${NUM_LINE} + 1")
83 # Ignore special doxygen blocks
84 if("${LINE}" MATCHES "^#ifndef DOXYGEN_API")
86 set(DOXYGEN_SKIP "next")
89 if("${LINE}" MATCHES "^#ifdef DOXYGEN_API")
91 set(DOXYGEN_SKIP "true")
94 if("${LINE}" MATCHES "^#endif /\\* DOXYGEN_API \\*/")
98 if("${LINE}" MATCHES "^#else")
99 if(DOXYGEN_SKIP STREQUAL "next")
100 set(DOXYGEN_SKIP "true")
101 elseif(DOXYGEN_SKIP STREQUAL "true")
102 set(DOXYGEN_SKIP "false")
106 if("${DOXYGEN_SKIP}" STREQUAL "true")
110 if("${LINE}" MATCHES "^([ ]*)\\* @api (.*)$")
111 set(LINE ${CMAKE_MATCH_2})
112 # By default, classes are not selected
114 set(API_SELECTED FALSE)
117 if("${APIUC}" STREQUAL "Template")
118 set(API_SELECTED TRUE)
119 if("${LINE}" STREQUAL "none" OR "${LINE}" STREQUAL "-all")
120 set(API_SELECTED FALSE)
125 if("${LINE}" STREQUAL "none" OR "${LINE}" STREQUAL "-all")
126 set(API_SELECTED FALSE)
127 elseif("${LINE}" MATCHES "-${APILC}")
128 set(API_SELECTED FALSE)
129 elseif("${LINE}" MATCHES "${APILC}")
130 set(API_SELECTED TRUE)
135 # Remove the old squirrel stuff
136 if("${LINE}" MATCHES "#ifdef DEFINE_SQUIRREL_CLASS")
137 set(SQUIRREL_STUFF TRUE)
140 if("${LINE}" MATCHES "^#endif /\\* DEFINE_SQUIRREL_CLASS \\*/")
141 unset(SQUIRREL_STUFF)
148 # Ignore forward declarations of classes
149 if("${LINE}" MATCHES "^( *)class(.*);")
153 # We only want to have public functions exported for now
154 if("${LINE}" MATCHES "^( *)class (.*) (: public|: protected|: private|:) ([^ ]*)")
156 if(NOT DEFINED API_SELECTED)
157 message(WARNING "Class '${CMAKE_MATCH_2}' has no @api. It won't be published to any API.")
158 set(API_SELECTED FALSE)
164 set(CLS_IN_API ${API_SELECTED})
166 set(CLS "${CMAKE_MATCH_2}")
167 set(SUPER_CLS "${CMAKE_MATCH_4}")
168 elseif(CLS_LEVEL EQUAL 1)
169 if(NOT DEFINED API_SELECTED)
170 set(API_SELECTED ${CLS_IN_API})
174 list(APPEND STRUCTS "${CLS}::${CMAKE_MATCH_2}")
178 math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
181 if("${LINE}" MATCHES "^( *)public")
182 if(CLS_LEVEL EQUAL 1)
187 if("${LINE}" MATCHES "^( *)protected")
188 if(CLS_LEVEL EQUAL 1)
193 if("${LINE}" MATCHES "^( *)private")
194 if(CLS_LEVEL EQUAL 1)
200 # Ignore the comments
201 if("${LINE}" MATCHES "^#")
204 if("${LINE}" MATCHES "/\\*.*\\*/")
208 if("${LINE}" MATCHES "/\\*")
212 if("${LINE}" MATCHES "\\*/")
220 # We need to make specialized conversions for structs
221 if("${LINE}" MATCHES "^( *)struct ([^ ]*)")
222 math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
224 # Check if we want to publish this struct
225 if(NOT DEFINED API_SELECTED)
226 set(API_SELECTED ${CLS_IN_API})
234 if(NOT IS_PUBLIC OR NOT CLS_LEVEL EQUAL 1)
238 list(APPEND STRUCTS "${CLS}::${CMAKE_MATCH_2}")
242 # We need to make specialized conversions for enums
243 if("${LINE}" MATCHES "^( *)enum ([^ ]*)")
244 math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
246 # Check if we want to publish this enum
247 if(NOT DEFINED API_SELECTED)
248 set(API_SELECTED ${CLS_IN_API})
261 list(APPEND ENUMS "${CLS}::${CMAKE_MATCH_2}")
265 # Maybe the end of the class, if so we can start with the Squirrel export pretty soon
266 if("${LINE}" MATCHES "};")
267 math(EXPR CLS_LEVEL "${CLS_LEVEL} - 1")
274 set(START_SQUIRREL_DEFINE_ON_NEXT_LINE TRUE)
279 # Empty/white lines. When we may do the Squirrel export, do that export.
280 if("${LINE}" MATCHES "^([ ]*)$")
281 if(NOT START_SQUIRREL_DEFINE_ON_NEXT_LINE)
290 if(NOT HAS_FILEHEADER)
292 set(HAS_FILEHEADER TRUE)
296 unset(NAMESPACE_OPENED)
298 string(REGEX REPLACE "^Script" "${APIUC}" API_CLS "${CLS}")
299 string(REGEX REPLACE "^Script" "${APIUC}" API_SUPER_CLS "${SUPER_CLS}")
301 string(APPEND SQUIRREL_EXPORT "\n")
303 if("${APIUC}" STREQUAL "Template")
304 # First check whether we have enums to print
306 if(NOT NAMESPACE_OPENED)
307 string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
308 set(NAMESPACE_OPENED TRUE)
310 string(APPEND SQUIRREL_EXPORT "\n /* Allow enums to be used as Squirrel parameters */")
311 foreach(ENUM IN LISTS ENUMS)
312 string(APPEND SQUIRREL_EXPORT "\n template <> struct Param<${ENUM}> { static inline ${ENUM} Get(HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; } };")
313 string(APPEND SQUIRREL_EXPORT "\n template <> struct Return<${ENUM}> { static inline int Set(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, res); return 1; } };")
317 # Then check whether we have structs/classes to print
319 if(NOT NAMESPACE_OPENED)
320 string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
321 set(NAMESPACE_OPENED TRUE)
323 string(APPEND SQUIRREL_EXPORT "\n /* Allow inner classes/structs to be used as Squirrel parameters */")
324 foreach(STRUCT IN LISTS STRUCTS)
325 dump_class_templates(${STRUCT})
329 if(NOT NAMESPACE_OPENED)
330 string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
331 set(NAMESPACE_OPENED TRUE)
333 string(APPEND SQUIRREL_EXPORT "\n")
335 string(APPEND SQUIRREL_EXPORT "\n /* Allow ${CLS} to be used as Squirrel parameter */")
336 dump_class_templates(${CLS})
338 string(APPEND SQUIRREL_EXPORT "\n} // namespace SQConvert")
344 string(APPEND SQUIRREL_EXPORT "\n")
345 string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ScriptType::${APIUC}>() { return \"${API_CLS}\"; }")
346 string(APPEND SQUIRREL_EXPORT "\n")
348 # Then do the registration functions of the class.
349 string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel *engine)")
350 string(APPEND SQUIRREL_EXPORT "\n{")
351 string(APPEND SQUIRREL_EXPORT "\n DefSQClass<${CLS}, ScriptType::${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
352 if("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
353 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine);")
355 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
357 if(NOT "${SUPER_CLS}" MATCHES "^ScriptEvent")
358 if("${CLS_PARAM_2}" STREQUAL "v")
359 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.AddSQAdvancedConstructor(engine);")
361 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.AddConstructor<void (${CLS}::*)(${CLS_PARAM_0}), ${CLS_PARAM_1}>(engine, \"${CLS_PARAM_2}\");")
364 string(APPEND SQUIRREL_EXPORT "\n")
368 foreach(ENUM_VALUE IN LISTS ENUM_VALUES)
369 string(LENGTH "${ENUM_VALUE}" LEN)
374 foreach(ENUM_VALUE IN LISTS ENUM_VALUES)
375 string(LENGTH "${ENUM_VALUE}" LEN)
376 math(EXPR LEN "${MLEN} - ${LEN}")
378 foreach(i RANGE ${LEN})
379 string(APPEND SPACES " ")
381 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQConst(engine, ${CLS}::${ENUM_VALUE},${SPACES}\"${ENUM_VALUE}\");")
384 string(APPEND SQUIRREL_EXPORT "\n")
389 foreach(CONST_VALUE IN LISTS CONST_VALUES)
390 string(LENGTH "${CONST_VALUE}" LEN)
395 foreach(CONST_VALUE IN LISTS CONST_VALUES)
396 string(LENGTH "${CONST_VALUE}" LEN)
397 math(EXPR LEN "${MLEN} - ${LEN}")
399 foreach(i RANGE ${LEN})
400 string(APPEND SPACES " ")
402 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQConst(engine, ${CLS}::${CONST_VALUE},${SPACES}\"${CONST_VALUE}\");")
405 string(APPEND SQUIRREL_EXPORT "\n")
408 # Mapping of OTTD strings to errors
410 foreach(ENUM_STRING_TO_ERROR IN LISTS ENUM_STRING_TO_ERRORS)
411 string(REPLACE ":" ";" ENUM_STRING_TO_ERROR "${ENUM_STRING_TO_ERROR}")
412 list(GET ENUM_STRING_TO_ERROR 0 ENUM_STRING)
413 string(LENGTH "${ENUM_STRING}" LEN)
418 foreach(ENUM_STRING_TO_ERROR IN LISTS ENUM_STRING_TO_ERRORS)
419 string(REPLACE ":" ";" ENUM_STRING_TO_ERROR "${ENUM_STRING_TO_ERROR}")
420 list(GET ENUM_STRING_TO_ERROR 0 ENUM_STRING)
421 list(GET ENUM_STRING_TO_ERROR 1 ENUM_ERROR)
422 string(LENGTH "${ENUM_STRING}" LEN)
423 math(EXPR LEN "${MLEN} - ${LEN}")
425 foreach(i RANGE ${LEN})
426 string(APPEND SPACES " ")
428 string(APPEND SQUIRREL_EXPORT "\n ScriptError::RegisterErrorMap(${ENUM_STRING},${SPACES}${CLS}::${ENUM_ERROR});")
431 string(APPEND SQUIRREL_EXPORT "\n")
434 # Mapping of errors to human 'readable' strings.
436 foreach(ENUM_ERROR_TO_STRING IN LISTS ENUM_ERROR_TO_STRINGS)
437 string(LENGTH "${ENUM_ERROR_TO_STRING}" LEN)
442 foreach(ENUM_ERROR_TO_STRING IN LISTS ENUM_ERROR_TO_STRINGS)
443 string(LENGTH "${ENUM_ERROR_TO_STRING}" LEN)
444 math(EXPR LEN "${MLEN} - ${LEN}")
446 foreach(i RANGE ${LEN})
447 string(APPEND SPACES " ")
449 string(APPEND SQUIRREL_EXPORT "\n ScriptError::RegisterErrorMapString(${CLS}::${ENUM_ERROR_TO_STRING},${SPACES}\"${ENUM_ERROR_TO_STRING}\");")
452 string(APPEND SQUIRREL_EXPORT "\n")
457 foreach(STATIC_METHOD IN LISTS STATIC_METHODS)
458 string(REPLACE ":" ";" STATIC_METHOD "${STATIC_METHOD}")
459 list(GET STATIC_METHOD 0 FUNCNAME)
460 string(LENGTH "${FUNCNAME}" LEN)
465 foreach(STATIC_METHOD IN LISTS STATIC_METHODS)
466 string(REPLACE ":" ";" STATIC_METHOD "${STATIC_METHOD}")
467 list(GET STATIC_METHOD 0 FUNCNAME)
468 list(GET STATIC_METHOD 1 ARGC)
469 list(GET STATIC_METHOD 2 TYPES)
470 string(LENGTH "${FUNCNAME}" LEN)
471 math(EXPR LEN "${MLEN} - ${LEN}")
472 if("${TYPES}" STREQUAL "v")
474 math(EXPR LEN "${LEN} - 8")
480 foreach(i RANGE ${LEN})
481 string(APPEND SPACES " ")
483 if("${TYPES}" STREQUAL "v")
484 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQAdvancedStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
486 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
490 string(APPEND SQUIRREL_EXPORT "\n")
495 foreach(METHOD IN LISTS METHODS)
496 string(REPLACE ":" ";" METHOD "${METHOD}")
497 list(GET METHOD 0 FUNCNAME)
498 string(LENGTH "${FUNCNAME}" LEN)
503 foreach(METHOD IN LISTS METHODS)
504 string(REPLACE ":" ";" METHOD "${METHOD}")
505 list(GET METHOD 0 FUNCNAME)
506 list(GET METHOD 1 ARGC)
507 list(GET METHOD 2 TYPES)
508 string(LENGTH "${FUNCNAME}" LEN)
509 math(EXPR LEN "${MLEN} - ${LEN}")
510 if("${TYPES}" STREQUAL "v")
512 math(EXPR LEN "${LEN} - 8")
518 foreach(i RANGE ${LEN})
519 string(APPEND SPACES " ")
521 if("${TYPES}" STREQUAL "v")
522 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQAdvancedMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
524 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.DefSQMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
528 string(APPEND SQUIRREL_EXPORT "\n")
531 string(APPEND SQUIRREL_EXPORT "\n SQ${API_CLS}.PostRegister(engine);")
532 string(APPEND SQUIRREL_EXPORT "\n}")
539 # Skip non-public functions
546 string(REGEX MATCH "([^, ]+)" ENUM_VALUE "${LINE}")
547 list(APPEND ENUM_VALUES "${ENUM_VALUE}")
549 # Check if this a special error enum
550 list(GET ENUMS -1 ENUM)
551 if("${ENUM}" MATCHES ".*::ErrorMessages")
553 # enum ErrorMessages {
554 # ERR_SOME_ERROR, // [STR_ITEM1, STR_ITEM2, ...]
558 if("${LINE}" MATCHES "\\[(.*)\\]")
559 string(REGEX REPLACE "[ ]" "" MAPPINGS "${CMAKE_MATCH_1}")
560 string(REPLACE "," ";" MAPPINGS "${MAPPINGS}")
562 foreach(MAPPING IN LISTS MAPPINGS)
563 list(APPEND ENUM_STRING_TO_ERRORS "${MAPPING}:${ENUM_VALUE}")
566 list(APPEND ENUM_ERROR_TO_STRINGS "${ENUM_VALUE}")
572 # Add a const (non-enum) value
573 if("${LINE}" MATCHES "^[ ]*static const [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
574 list(APPEND CONST_VALUES "${CMAKE_MATCH_1}")
578 # Add a method to the list
579 if("${LINE}" MATCHES "^.*\\(.*\\).*$")
580 if(NOT CLS_LEVEL EQUAL 1)
583 if("${LINE}" MATCHES "~")
584 if(DEFINED API_SELECTED)
585 message(WARNING "Destructor for '${CLS}' has @api. Tag ignored.")
592 if("${LINE}" MATCHES "static")
596 string(REGEX REPLACE "(virtual|static|const)[ ]+" "" LINE "${LINE}")
597 string(REGEX REPLACE "{.*" "" LINE "${LINE}")
598 set(PARAM_S "${LINE}")
599 string(REGEX REPLACE "\\*" "" LINE "${LINE}")
600 string(REGEX REPLACE "\\(.*" "" LINE "${LINE}")
602 string(REGEX REPLACE ".*\\(" "" PARAM_S "${PARAM_S}")
603 string(REGEX REPLACE "\\).*" "" PARAM_S "${PARAM_S}")
605 string(REGEX MATCH "([^ ]+)( ([^ ]+))?" RESULT "${LINE}")
606 set(FUNCTYPE "${CMAKE_MATCH_1}")
607 set(FUNCNAME "${CMAKE_MATCH_3}")
608 if("${FUNCTYPE}" STREQUAL "${CLS}" AND NOT FUNCNAME)
609 if(DEFINED API_SELECTED)
610 message(WARNING "Constructor for '${CLS}' has @api. Tag ignored.")
613 set(CLS_PARAM_0 "${PARAM_S}")
621 string(REPLACE "," ";" PARAMS "${PARAM_S}")
629 foreach(PARAM IN LISTS PARAMS)
630 math(EXPR LEN "${LEN} + 1")
631 string(STRIP "${PARAM}" PARAM)
632 if("${PARAM}" MATCHES "\\*|&")
633 if("${PARAM}" MATCHES "^char")
634 # Many types can be converted to string, so use '.', not 's'. (handled by our glue code)
635 string(APPEND TYPES ".")
636 elseif("${PARAM}" MATCHES "^void")
637 string(APPEND TYPES "p")
638 elseif("${PARAM}" MATCHES "^Array")
639 string(APPEND TYPES "a")
640 elseif("${PARAM}" MATCHES "^const Array")
641 string(APPEND TYPES "a")
642 elseif("${PARAM}" MATCHES "^Text")
643 string(APPEND TYPES ".")
644 elseif("${PARAM}" MATCHES "^std::string")
645 string(APPEND TYPES ".")
647 string(APPEND TYPES "x")
649 elseif("${PARAM}" MATCHES "^bool")
650 string(APPEND TYPES "b")
651 elseif("${PARAM}" MATCHES "^HSQUIRRELVM")
654 string(APPEND TYPES "i")
658 # Check if we want to publish this function
659 if(NOT DEFINED API_SELECTED)
660 set(API_SELECTED ${CLS_IN_API})
668 if("${FUNCTYPE}" STREQUAL "${CLS}" AND NOT FUNCNAME)
669 set(CLS_PARAM_1 ${LEN})
670 set(CLS_PARAM_2 "${TYPES}")
671 elseif("${FUNCNAME}" MATCHES "^_" AND NOT "${TYPES}" STREQUAL "v")
673 list(APPEND STATIC_METHODS "${FUNCNAME}:${LEN}:${TYPES}")
675 list(APPEND METHODS "${FUNCNAME}:${LEN}:${TYPES}")
683 configure_file(${SCRIPT_API_SOURCE_FILE} ${SCRIPT_API_BINARY_FILE})