@@ -23,12 +23,6 @@ build_dir = f"build/{lua_runtime}.{env["suffix"][1:]}"
2323env ["build_dir" ] = build_dir
2424VariantDir (build_dir , "src" , duplicate = False )
2525
26- source_directories = ["." , "luaopen" , "utils" , "script-language" ]
27- sources = [
28- Glob (f"{ build_dir } /{ directory } /*.cpp" )
29- for directory in source_directories
30- ]
31-
3226# Add support for generating compilation database files
3327env .Tool ("compilation_db" )
3428compiledb = env .CompilationDatabase ("compile_commands.json" )
@@ -65,19 +59,25 @@ env.remove_options(env["CXXFLAGS"], "-fno-exceptions")
6559if env ["platform" ] == "windows" and not env ["use_mingw" ]:
6660 env .Append (CXXFLAGS = "/EHsc" )
6761
62+ # Setup Lua, LuaJIT and Sol2
6863if lua_runtime == "lua" :
6964 env .Tool ("lua" , toolpath = ["tools" ])
7065elif lua_runtime == "luajit" :
7166 env .Tool ("luajit" , toolpath = ["tools" ])
7267env .Tool ("sol2" , toolpath = ["tools" ])
7368
69+ # Build Lua GDExtension
70+ source_directories = ["." , "luaopen" , "utils" , "script-language" ]
71+ sources = [
72+ Glob (f"{ build_dir } /{ directory } /*.cpp" )
73+ for directory in source_directories
74+ ]
7475
75- # Generate document
76+ # Generate documentation source file
7677if env ["target" ] in ["editor" , "template_debug" ]:
7778 doc_data = env .GodotCPPDocData ("src/generated-document/doc_data.gen.cpp" , source = Glob ("doc_classes/*.xml" ))
7879 sources .append (doc_data )
7980
80- # Build Lua GDExtension
8181if env ["platform" ] == "ios" :
8282 library = env .StaticLibrary (
8383 f"{ build_dir } /libluagdextension{ env ["suffix" ]} { env ["LIBSUFFIX" ]} " ,
0 commit comments