From 33a4bb2b142f711f5825b8d695117ee406e6993b Mon Sep 17 00:00:00 2001 From: milek Date: Mon, 25 Mar 2019 20:17:27 +0000 Subject: [PATCH] fix compiling on MacOS --- CMakeLists.txt | 4 ++++ EU07.cpp | 2 +- stdafx.h | 6 ++++++ widgets/popup.h | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22b66f7f..3484c9af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ file(GLOB HEADERS "*.h" "network/backend/*.h" "widgets/*.h") +if (APPLE) + set (CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000") +endif() + option(USE_IMGUI_GL3 "Use OpenGL3+ imgui implementation" ON) option(WITH_UART "Compile with libserialport" OFF) diff --git a/EU07.cpp b/EU07.cpp index 0e872467..362a9d08 100644 --- a/EU07.cpp +++ b/EU07.cpp @@ -34,8 +34,8 @@ int main( int argc, char *argv[] ) auto result { Application.init( argc, argv ) }; if( result == 0 ) { result = Application.run(); + Application.exit(); } - Application.exit(); } catch( std::bad_alloc const &Error ) { diff --git a/stdafx.h b/stdafx.h index 3df21b97..c6857a69 100644 --- a/stdafx.h +++ b/stdafx.h @@ -6,6 +6,12 @@ #ifndef STDAFX_H #define STDAFX_H +#ifdef __APPLE__ +#ifndef __unix__ +#define __unix__ 1 +#endif +#endif + #define _USE_MATH_DEFINES #include #ifdef _MSC_VER diff --git a/widgets/popup.h b/widgets/popup.h index 26ad5e19..7ce8a339 100644 --- a/widgets/popup.h +++ b/widgets/popup.h @@ -10,7 +10,7 @@ class popup { public: popup(ui_panel &panel); - ~popup(); + virtual ~popup(); bool render();