mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
windows: use 'windows' subsystem for release build
Only show the console on debug builds. Fixes item 2 in #177.
This commit is contained in:
+1
-1
@@ -137,7 +137,7 @@ _Noreturn void vm_reset(void);
|
||||
|
||||
extern bool vm_reset_once;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#if defined(__ANDROID__) || defined(RELEASE)
|
||||
// Report the error with a message box and exit.
|
||||
#define VM_ERROR ERROR
|
||||
#else
|
||||
|
||||
@@ -4,6 +4,10 @@ project('system4', 'c',
|
||||
add_project_arguments('-D_DEFAULT_SOURCE', language : 'c')
|
||||
add_project_arguments('-DXSYS4_DATA_DIR="' + get_option('prefix') / get_option('datadir') / 'xsystem4"', language : 'c')
|
||||
|
||||
if get_option('buildtype').startswith('release')
|
||||
add_project_arguments('-DRELEASE', language : 'c')
|
||||
endif
|
||||
|
||||
static_libs = false
|
||||
if host_machine.system() == 'windows'
|
||||
static_libs = true
|
||||
|
||||
@@ -190,9 +190,15 @@ if host_machine.system() == 'windows'
|
||||
static_link_args = ['-static', '-lstdc++']
|
||||
endif
|
||||
|
||||
winsys = 'console'
|
||||
if get_option('buildtype').startswith('release')
|
||||
winsys = 'windows'
|
||||
endif
|
||||
|
||||
executable('xsystem4', xsystem4,
|
||||
dependencies : xsystem4_deps,
|
||||
c_args : ['-Wno-unused-parameter'],
|
||||
link_args : static_link_args,
|
||||
include_directories : incdir,
|
||||
win_subsystem : winsys,
|
||||
install : true)
|
||||
|
||||
+2
-19
@@ -402,31 +402,14 @@ enum {
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
static void windows_error_handler(const char *msg)
|
||||
{
|
||||
sys_warning("%s", msg);
|
||||
sys_warning("Press the enter key to exit...\n");
|
||||
getchar();
|
||||
sys_exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
static void android_error_handler(const char *msg)
|
||||
static void error_handler(const char *msg)
|
||||
{
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "xsystem4", msg, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef _WIN32
|
||||
sys_error_handler = windows_error_handler;
|
||||
#endif
|
||||
#ifdef __ANDROID__
|
||||
sys_error_handler = android_error_handler;
|
||||
#endif
|
||||
sys_error_handler = error_handler;
|
||||
|
||||
initialize_instructions();
|
||||
char *ainfile;
|
||||
|
||||
Reference in New Issue
Block a user