Release build and packaging

This commit is contained in:
Krzosa Karol
2026-01-07 22:26:18 +01:00
parent 239126db70
commit 101fed6d7d
5 changed files with 23 additions and 15 deletions

View File

@@ -1,4 +1,12 @@
@echo off
setlocal enabledelayedexpansion
cd /D "%~dp0"
for %%a in (%*) do set "%%~a=1"
if not "%release%"=="1" set debug=1
if "%debug%"=="1" set release=0 && echo [debug mode]
if "%release%"=="1" set debug=0 && echo [release mode]
if "%package%"=="1" echo [package zip]
if not exist "src\external\SDL" (
pushd src\external
@@ -7,21 +15,30 @@ if not exist "src\external\SDL" (
git checkout release-3.4.0
cmake -S . -B build_win32_static -DCMAKE_BUILD_TYPE=Release -DSDL_STATIC=ON
pushd build_win32_static
msbuild SDL3.sln
msbuild SDL3.sln -maxCpuCount:16 -p:Configuration=Release
popd
popd
popd
)
set sdl=..\src\external\SDL
set sdllib=%sdl%\build_win32_static\Debug
set sdllib=%sdl%\build_win32_static\Release
mkdir build
pushd build
set flags=/EHsc- /MD /Zi /FC /nologo /WX /W3 /wd4200 /wd4334 /diagnostics:column -DDEBUG_BUILD=1
set flags=/EHsc- /MT /Zi /FC /nologo /WX /W3 /wd4200 /wd4334 /diagnostics:column
if "%release%"=="1" set flags=%flags% -O2 -DDEBUG_BUILD=0
set libs=%sdllib%/SDL3-static.lib %sdllib%/SDL_uclibc.lib kernel32.lib gdi32.lib user32.lib Imm32.lib ole32.lib Shell32.lib OleAut32.lib Cfgmgr32.lib Setupapi.lib Advapi32.lib version.lib winmm.lib
cl %flags% ../src/text_editor/text_editor.cpp -Fe:te.exe -I%sdl%/include -I../src/external/glad -I../src/ %libs% -link /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:MSVCRTD
:: small util when working on the editor using the editor
copy te.exe te2.exe
popd
rem /fsanitize=address
if "%package%"=="1" (
copy build\te.exe .
"C:\Program Files\7-Zip\7z.exe" a te.zip te.exe
del te.exe
)

View File

@@ -2,9 +2,7 @@
! From a user (novice) point of view, how does it look like?
- Buffer edit history separate from caret history (tagging history blocks with carets???)
- Search and replace
- We need regex for: [FormatCode matching, IsCode matching,
- IndentKind has issues with stuff still like cleaning whitespace etc.
- Remedybg commands integrated! (like clicking f5 and opening up the window)
- Macros
- ctrl-e started doing no-ops again ... ??

View File

@@ -5,12 +5,8 @@ struct LocationTrace {
int line;
};
#if DEBUG_BUILD
thread_local LocationTrace LocationTraceO;
#define LOCATION_TRACE (LocationTraceO.file = __FILE__, LocationTraceO.line = __LINE__)
#else
#define LOCATION_TRACE
#endif
const int AllocatorKind_Allocate = 1;
const int AllocatorKind_Deallocate = 2;

View File

@@ -8,11 +8,7 @@ bool WaitForEventsState = true;
bool RunGCThisFrame;
bool SearchCaseSensitive = false;
bool SearchWordBoundary = false;
#if OS_WINDOWS
bool BreakOnError = true;
#else
bool BreakOnError = false;
#endif
WindowID WindowIDs;
ViewID ViewIDs;

View File

@@ -1,4 +1,4 @@
#if 1
#if BUILD_DEBUG
// SPDX-FileCopyrightText: © 2023 Phillip Trudeau-Tavara <pmttavara@protonmail.com>
// SPDX-License-Identifier: MIT
@@ -404,6 +404,7 @@ struct ProfileScopeClass {
~ProfileScopeClass() { EndProfileScope(); }
};
#else
#define ProfileScopeEx(name)
#define ProfileScope(name)
#define ProfileFunction()
#define BeginProfiler()