diff --git a/Makefile b/Makefile index be3386c66..03602cc27 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,12 @@ else endif ifdef BUILD_QB64 - EXE ?= qb64 -else + ifeq ($(OS),win) + EXE ?= qb64.exe + else + EXE ?= qb64 + endif +endif ifneq ($(filter clean,$(MAKECMDGOALS)),) # We have to define this for the Makefile to work, @@ -97,8 +101,6 @@ ifndef EXE $(error Please provide executable name as 'EXE=executable') endif -endif - all: $(EXE) CLEAN_LIST := @@ -341,6 +343,8 @@ clean: $(EXE): $(EXE_OBJS) $(EXE_LIBS) $(CXX) $(CXXFLAGS) $(EXE_OBJS) -o $@ $(EXE_LIBS) $(CXXLIBS) +ifneq ($(filter-out osx,$(OS)),) $(OBJCOPY) --only-keep-debug $@ $(PATH_INTERNAL_TEMP)/$@.sym $(OBJCOPY) --strip-unneeded $@ +endif diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 1e1347074..5d37b4b32 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -27355,19 +27355,11 @@ void sub__icon(int32 handle_icon, int32 handle_window_icon, int32 passed) { #endif // DEPENDENCY_ICON int32 func_screenwidth() { -#ifdef QB64_GLUT - while (!window_exists) { - Sleep(100); - } -# ifdef QB64_WINDOWS - while (!window_handle) { - Sleep(100); - } -# endif - return glutGet(GLUT_SCREEN_WIDTH); +#ifdef QB64_WINDOWS + return GetSystemMetrics(SM_CXSCREEN); #else -# ifdef QB64_WINDOWS - return GetSystemMetrics(0); +# ifdef QB64_GLUT + return glutGet(GLUT_SCREEN_WIDTH); # else return 0; # endif @@ -27375,19 +27367,11 @@ int32 func_screenwidth() { } int32 func_screenheight() { -#ifdef QB64_GLUT - while (!window_exists) { - Sleep(100); - } -# ifdef QB64_WINDOWS - while (!window_handle) { - Sleep(100); - } -# endif - return glutGet(GLUT_SCREEN_HEIGHT); +#ifdef QB64_WINDOWS + return GetSystemMetrics(SM_CYSCREEN); #else -# ifdef QB64_WINDOWS - return GetSystemMetrics(1); +# ifdef QB64_GLUT + return glutGet(GLUT_SCREEN_HEIGHT); # else return 0; # endif @@ -27400,6 +27384,7 @@ void sub_screenicon() { Sleep(100); } # ifdef QB64_WINDOWS + while (!window_handle) { Sleep(100); } diff --git a/internal/source/qb64.sym b/internal/source/qb64.sym index 0891d4f53..32f592814 100755 Binary files a/internal/source/qb64.sym and b/internal/source/qb64.sym differ diff --git a/internal/source/qb64_bootstrap.sym b/internal/source/qb64_bootstrap.sym index 0891d4f53..32f592814 100755 Binary files a/internal/source/qb64_bootstrap.sym and b/internal/source/qb64_bootstrap.sym differ diff --git a/setup_win.bat b/setup_win.bat index a99ef045a..3b5339df0 100644 --- a/setup_win.bat +++ b/setup_win.bat @@ -19,8 +19,11 @@ echo Extracting %MINGW% as C++ Compiler :skipccompsetup -internal\c\c_compiler\bin\mingw32-make.exe OS=win clean -internal\c\c_compiler\bin\mingw32-make.exe OS=win BUILD_QB64=y +echo Cleaning... +internal\c\c_compiler\bin\mingw32-make.exe OS=win clean >NUL 2>NUL + +echo Building QB64... +internal\c\c_compiler\bin\mingw32-make.exe OS=win BUILD_QB64=y || goto report_error echo. echo Launching 'QB64' @@ -28,3 +31,10 @@ qb64 echo. pause + +exit 0 + +report_error: +echo "Error compiling QB64." +echo "Please review above steps and report to https://github.com/QB64-Phoenix-Edition/QB64pe/issues if you can't get it to work" +exit 1