Remove -l (list files) argument from generate.py script. Because the function was broken.
This function was only used by the CMake script, the invocation was removed.
MODIFY
builds/cmake/CMakeLists.txt
builds/cmake/CMakeLists.txt
@@ -31,34 +31,8 @@ if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
endif()
endif()
-find_package(PythonInterp)
set(GENERATED_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../src/generated)
-if(PYTHONINTERP_FOUND)
- set(GENERATE_PY "${CMAKE_CURRENT_SOURCE_DIR}/../../generator/generate.py")
-
- file(GLOB tmpl "${CMAKE_CURRENT_SOURC_DIR}/../../generator/templates/*.tmpl")
- file(GLOB csv "${CMAKE_CURRENT_SOURC_DIR}/../../generator/csv/*.csv")
-
- execute_process(
- COMMAND "${PYTHON_EXECUTABLE}" "${GENERATE_PY}" "-l"
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../generator"
- OUTPUT_VARIABLE gen_list)
- string(REPLACE "\n" ";" gen_list "${gen_list}")
- foreach(i ${gen_list})
- if(${i} MATCHES "\\.cpp")
- list(APPEND GEN_SRCS ${GENERATED_OUTPUT_DIR}/${i})
- endif()
- endforeach()
-
- add_custom_command(
- OUTPUT ${GEN_SRCS}
- COMMAND ${PYTHON_EXECUTABLE} ${GENERATE_PY}
- MAIN_DEPENDENCT ${GENERATE_PY}
- DEPENDS ${GENERATE_PY} ${tmpl} ${csv}
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../generator")
-else()
aux_source_directory(${GENERATED_OUTPUT_DIR} GEN_SRCS)
-endif()
aux_source_directory("${CMAKE_CURRENT_SOURCE_DIR}/../../src" SRCS)
add_library(${PROJECT_NAME} STATIC ${GEN_SRCS} ${SRCS})

MODIFY
generator/generate.py
generator/generate.py
@@ -314,34 +314,6 @@ def generate():
os.remove(tmp_path)
os.rmdir(tmp_dir)
-def list_files_struct(filetype, filename, struct_name, hasid):
- if struct_name not in sfields:
- return
- print('%s_%s.cpp' % (filetype, filename))
- if needs_ctor(struct_name):
- print('rpg_%s.cpp' % filename)
- print('rpg_%s.h' % filename)
-
-def list_files_rawstruct(filename, struct_name):
- if needs_ctor(struct_name):
- print('rpg_%s.cpp' % filename)
- print('rpg_%s.h' % filename)
-
-def list_files_flags(filetype, filename, struct_name):
- print('%s_%s_flags.cpp' % (filetype, filename))
-
-def list_files():
- for filetype in ['ldb','lmt','lmu','lsd']:
- print('%s_chunks.h' % filetype)
-
- for filetype, filename, struct_name, hasid in structs:
- if hasid is not None:
- list_files_struct(filetype, filename, struct_name, hasid)
- else:
- list_files_rawstruct(filename, struct_name)
- if struct_name in flags:
- list_files_flags(filetype, filename, struct_name)
-
def main(argv):
if not os.path.exists(dest_dir):
os.mkdir(dest_dir)
@@ -379,9 +351,6 @@ def main(argv):
rpg_source_tmpl = env.get_template('rpg_source.tmpl', globals=globals)
flags_tmpl = env.get_template('flag_reader.tmpl', globals=globals)
- if argv[1:] == ['-l']:
- list_files()
- else:
generate()
if __name__ == '__main__':

Remove -l (list files) argument from generate.py script. Because the function was broken.
This function was only used by the CMake script, the invocation was removed.