1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Allow for debug builds with debug information.

This commit is contained in:
Sandu Liviu Catalin 2020-04-30 21:34:10 +03:00
parent b93deee276
commit 69e8a9377c
5 changed files with 23 additions and 2 deletions

View File

@ -22,8 +22,10 @@ else()
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif() endif()
# Default to release mode # Determine if build mode
set(CMAKE_BUILD_TYPE "Release") if(CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options(-g)
endif()
# Include mingw runntime into the binary # Include mingw runntime into the binary
if (GCC OR MINGW) if (GCC OR MINGW)

View File

@ -90,6 +90,12 @@ if(ENABLE_MYSQL)
target_link_libraries(SqModule MySQL::MySQL) target_link_libraries(SqModule MySQL::MySQL)
endif() endif()
endif() endif()
# Determine if build mode
if(CMAKE_BUILD_TYPE MATCHES Release)
target_compile_definitions(SqModule PRIVATE NDEBUG=1)
else()
target_compile_definitions(SqModule PRIVATE _DEBUG=1 SQMOD_EXCEPTLOC=1)
endif()
# Force 32-bit binaries when necessary # Force 32-bit binaries when necessary
if(FORCE_32BIT_BIN) if(FORCE_32BIT_BIN)
set_target_properties(SqModule PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") set_target_properties(SqModule PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")

View File

@ -14,6 +14,12 @@ add_library(Sqrat STATIC sqrat.cpp sqrat.h
sqrat/sqratTypes.h sqrat/sqratTypes.h
sqrat/sqratUtil.h sqrat/sqratUtil.h
) )
# Determine if build mode
if(CMAKE_BUILD_TYPE MATCHES Release)
target_compile_definitions(Sqrat PRIVATE NDEBUG=1)
else()
target_compile_definitions(Sqrat PRIVATE _DEBUG=1)
endif()
# Set library compiler options # Set library compiler options
target_compile_definitions(Sqrat PUBLIC SCRAT_USE_EXCEPTIONS=1 SCRAT_USE_CXX11_OPTIMIZATIONS=1) target_compile_definitions(Sqrat PUBLIC SCRAT_USE_EXCEPTIONS=1 SCRAT_USE_CXX11_OPTIMIZATIONS=1)
# Set specific compiler options # Set specific compiler options

View File

@ -40,6 +40,12 @@ add_library(Squirrel STATIC
stdlib/sqstdstring.cpp stdlib/sqstdstring.cpp
stdlib/sqstdsystem.cpp stdlib/sqstdsystem.cpp
) )
# Determine if build mode
if(CMAKE_BUILD_TYPE MATCHES Release)
target_compile_definitions(Squirrel PRIVATE NDEBUG=1)
else()
target_compile_definitions(Squirrel PRIVATE _DEBUG=1)
endif()
# Make sure Squirrel knows this is 64 bit # Make sure Squirrel knows this is 64 bit
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)
target_compile_definitions(Squirrel PUBLIC _SQ64) target_compile_definitions(Squirrel PUBLIC _SQ64)

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
//#define VCMP_SDK_2_1
// Choose which SDK to use // Choose which SDK to use
#ifdef VCMP_SDK_2_1 #ifdef VCMP_SDK_2_1
#include "vcmp21.h" #include "vcmp21.h"