Parcourir la source

Do not strip debug info (in debug/development mode) when compiling Lua resources

Daniele Bartolini il y a 12 ans
Parent
commit
bb2363d3c9
1 fichiers modifiés avec 12 ajouts et 4 suppressions
  1. 12 4
      engine/compilers/lua/LuaCompiler.cpp

+ 12 - 4
engine/compilers/lua/LuaCompiler.cpp

@@ -24,6 +24,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 */
 
+#include "Config.h"
 #include "LuaCompiler.h"
 #include "LuaResource.h"
 #include "TempAllocator.h"
@@ -35,11 +36,18 @@ namespace crown
 {
 
 #ifdef WINDOWS
-	#define LUAJIT "luajit.exe"
+	#define LUAJIT_EXECUTABLE "luajit.exe"
 #else
-	#define LUAJIT "./luajit"
+	#define LUAJIT_EXECUTABLE "./luajit"
 #endif
 
+#if defined(CROWN_DEBUG) || defined(CROWN_DEVELOPMENT)
+	#define LUAJIT_FLAGS "-bg" // Keep debug info
+#else
+	#define LUAJIT_FLAGS "-b"
+#endif
+
+
 
 //-----------------------------------------------------------------------------
 LuaCompiler::LuaCompiler()
@@ -64,8 +72,8 @@ size_t LuaCompiler::compile_impl(Filesystem& fs, const char* resource_path)
 
 	const char* luajit[] =
 	{
-		LUAJIT,
-		"-b",
+		LUAJIT_EXECUTABLE,
+		LUAJIT_FLAGS,
 		res_abs_path.c_str(),
 		bc_abs_path.c_str(),
 		NULL