AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
Writing platform dependent code

AUI provides set of AUI_PLATFORM_* and AUI_COMPILER_* definitions for platform and compiler checking to use in both CMake and C++.

Platform checks

Platform C++ CMake Platform specific dir
Windows
#if AUI_PLATFORM_WIN
// ...
#endif
if(AUI_PLATFORM_WIN)
# ...
endif()

Platform/win32

Linux (not Android)
#if AUI_PLATFORM_LINUX
// ...
#endif
if(AUI_PLATFORM_LINUX)
# ...
endif()

Platform/linux

macOS
#if AUI_PLATFORM_MACOS
// ...
#endif
if(AUI_PLATFORM_MACOS)
# ...
endif()

Platform/macos

Android
#if AUI_PLATFORM_ANDROID
// ...
#endif
if(AUI_PLATFORM_ANDROID)
# ...
endif()

Platform/android

iOS (both iPhone and iPad)
#if AUI_PLATFORM_IOS
// ...
#endif
if(AUI_PLATFORM_IOS)
# ...
endif()

Platform/ios

Apple (macOS, iOS)
#if AUI_PLATFORM_APPLE
// ...
#endif
if(AUI_PLATFORM_APPLE)
# ...
endif()

Platform/apple

Unix (Linux, Android, macOS, iOS)
#if AUI_PLATFORM_UNIX
// ...
#endif
if(AUI_PLATFORM_UNIX)
# ...
endif()

Platform/unix

Emscripten
#if AUI_PLATFORM_EMSCRIPTEN
// ...
#endif
if(AUI_PLATFORM_EMSCRIPTEN)
# ...
endif()
Platform/emscripten

Platform specific sources

With AUI, the platform dependent code can be placed in src/Platform/<PLATFORM_NAME> dir, where <PLATFORM_NAME> is one of the supported platforms (see the table above).

Compiler checks

Compiler C++ CMake
MSVC
#if AUI_COMPILER_MSVC
// ...
#endif
if(AUI_COMPILER_MSVC)
# ...
endif()

GCC (including MinGW)
#if AUI_COMPILER_GCC
// ...
#endif
if(AUI_COMPILER_GCC)
# ...
endif()

CLANG
#if AUI_COMPILER_CLANG
// ...
#endif
if(AUI_COMPILER_CLANG)
# ...
endif()

Other

AUI_MODULE_NAME

Target name exposed by aui_module and aui_executable.

API_<module name>

dllexport (on Windows) or visibility (on other platforms) policy for the symbol.

class API_AUI_VIEWS AView ... { // defined in aui.views module
...
};
Base class of all UI objects.
Definition: AView.h:77