Add debug flag when building emscripten in debug mode.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/35/head
Nic0Nic0Nii 10 months ago
parent 973813f0b5
commit 2e3e8dd910
  1. 4
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 8
      Adventures in Lestoria/Error.h
  3. 2
      Adventures in Lestoria/assets/config/configuration.txt
  4. 6
      CMakeLists.txt
  5. 2
      debug.sh
  6. 2
      emscripten_debug_build.ps1

@ -2233,6 +2233,8 @@ int main()
}
#ifdef _DEBUG
#ifndef __EMSCRIPTEN__
#ifndef __linux__
HANDLE hLogFile;
hLogFile = CreateFile(L"assets/memoryleak.txt", GENERIC_WRITE,
FILE_SHARE_WRITE, NULL, CREATE_ALWAYS,
@ -2259,6 +2261,8 @@ int main()
}
if(leaked)ERR("")
#endif
#endif
#endif
return 0;
}

@ -44,12 +44,20 @@ All rights reserved.
#include <source_location>
#ifdef _DEBUG
#ifndef __EMSCRIPTEN__
#ifndef __linux__
#define NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
// Replace _NORMAL_BLOCK with _CLIENT_BLOCK if you want the
// allocations to be of _CLIENT_BLOCK type
#else
#define NEW new
#endif
#else
#define NEW new
#endif
#else
#define NEW new
#endif
#undef ERR //Stupid Windows

@ -120,7 +120,7 @@ debug_access_options = 0
debug_menu_navigation_info = 0
# Shows map loading output
debug_map_load_info = 1
debug_map_load_info = 0
# Shows state transition information
debug_transition_info = 0

@ -312,6 +312,12 @@ if (EMSCRIPTEN)
# Build Cache: SDL2_mixer, libpng, zlib
execute_process(COMMAND "${EMSCRIPTEN_ROOT_PATH}/embuilder${EMCC_SUFFIX}" build sdl2_mixer freetype libpng zlib)
target_compile_definitions(
${OutputExecutable}
PUBLIC
$<$<CONFIG:Debug>:_DEBUG>
)
if(EXISTS "${SOURCE_DATA_DIR}" AND IS_DIRECTORY "${SOURCE_DATA_DIR}")
target_link_options(
${OutputExecutable}

@ -1 +1 @@
cmake -DCMAKE_BUILD_TYPE=Debug .;make -j 8
cmake -DCMAKE_BUILD_TYPE=Debug -D_DEBUG=1 .;make -j 8

@ -1,3 +1,3 @@
clear
emcmake cmake -DCMAKE_BUILD_TYPE=Debug .
emcmake cmake -DCMAKE_BUILD_TYPE=Debug -D_DEBUG=1 .
cmake --build . -j 8
Loading…
Cancel
Save