LMMS
Loading...
Searching...
No Matches
juce_TargetPlatform.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23#pragma once
24
25//==============================================================================
26/* This file figures out which platform is being built, and defines some macros
27 that the rest of the code can use for OS-specific compilation.
28
29 Macros that will be set here are:
30
31 - One of JUCE_WINDOWS, JUCE_MAC JUCE_LINUX, JUCE_IOS, JUCE_ANDROID, etc.
32 - Either JUCE_32BIT or JUCE_64BIT, depending on the architecture.
33 - Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN.
34 - Either JUCE_INTEL or JUCE_ARM
35 - Either JUCE_GCC or JUCE_CLANG or JUCE_MSVC
36*/
37
38//==============================================================================
39#include "AppConfig.h"
40
41//==============================================================================
42#if defined (_WIN32) || defined (_WIN64)
43 #define JUCE_WINDOWS 1
44#elif defined (JUCE_ANDROID)
45 #undef JUCE_ANDROID
46 #define JUCE_ANDROID 1
47#elif defined (__FreeBSD__) || (__OpenBSD__)
48 #define JUCE_BSD 1
49#elif defined (__wasm__)
50 #define JUCE_WASM 1
51#elif defined (LINUX) || defined (__linux__)
52 #define JUCE_LINUX 1
53#elif defined (__APPLE_CPP__) || defined (__APPLE_CC__)
54 #define CF_EXCLUDE_CSTD_HEADERS 1
55 #include <TargetConditionals.h> // (needed to find out what platform we're using)
56 #include <AvailabilityMacros.h>
57
58 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
59 #define JUCE_IPHONE 1
60 #define JUCE_IOS 1
61 #else
62 #define JUCE_MAC 1
63 #endif
64#else
65 #error "Unknown platform!"
66#endif
67
68//==============================================================================
69#if JUCE_WINDOWS
70 #ifdef _MSC_VER
71 #ifdef _WIN64
72 #define JUCE_64BIT 1
73 #else
74 #define JUCE_32BIT 1
75 #endif
76 #endif
77
78 #ifdef _DEBUG
79 #define JUCE_DEBUG 1
80 #endif
81
82 #ifdef __MINGW32__
83 #define JUCE_MINGW 1
84 #ifdef __MINGW64__
85 #define JUCE_64BIT 1
86 #else
87 #define JUCE_32BIT 1
88 #endif
89 #endif
90
92 #define JUCE_LITTLE_ENDIAN 1
93
94 #define JUCE_INTEL 1
95#endif
96
97//==============================================================================
98#if JUCE_MAC || JUCE_IOS
99
100 #if defined (DEBUG) || defined (_DEBUG) || ! (defined (NDEBUG) || defined (_NDEBUG))
101 #define JUCE_DEBUG 1
102 #endif
103
104 #if ! (defined (DEBUG) || defined (_DEBUG) || defined (NDEBUG) || defined (_NDEBUG))
105 #warning "Neither NDEBUG or DEBUG has been defined - you should set one of these to make it clear whether this is a release build,"
106 #endif
107
108 #ifdef __LITTLE_ENDIAN__
109 #define JUCE_LITTLE_ENDIAN 1
110 #else
111 #define JUCE_BIG_ENDIAN 1
112 #endif
113
114 #ifdef __LP64__
115 #define JUCE_64BIT 1
116 #else
117 #define JUCE_32BIT 1
118 #endif
119
120 #if defined (__ppc__) || defined (__ppc64__)
121 #error "PowerPC is no longer supported by JUCE!"
122 #elif defined (__arm__) || defined (__arm64__)
123 #define JUCE_ARM 1
124 #else
125 #define JUCE_INTEL 1
126 #endif
127
128 #if JUCE_MAC
129 #if ! defined (MAC_OS_X_VERSION_10_14)
130 #error "The 10.14 SDK (Xcode 10.1+) is required to build JUCE apps. You can create apps that run on macOS 10.7+ by changing the deployment target."
131 #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
132 #error "Building for OSX 10.6 is no longer supported!"
133 #endif
134 #endif
135#endif
136
137//==============================================================================
138#if JUCE_LINUX || JUCE_ANDROID || JUCE_BSD
139
140 #ifdef _DEBUG
141 #define JUCE_DEBUG 1
142 #endif
143
144 // Allow override for big-endian Linux platforms
145 #if defined (__LITTLE_ENDIAN__) || ! defined (JUCE_BIG_ENDIAN)
146 #define JUCE_LITTLE_ENDIAN 1
147 #undef JUCE_BIG_ENDIAN
148 #else
149 #undef JUCE_LITTLE_ENDIAN
150 #define JUCE_BIG_ENDIAN 1
151 #endif
152
153 #if defined (__LP64__) || defined (_LP64) || defined (__arm64__)
154 #define JUCE_64BIT 1
155 #else
156 #define JUCE_32BIT 1
157 #endif
158
159 #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
160 #define JUCE_ARM 1
161 #elif __MMX__ || __SSE__ || __amd64__
162 #define JUCE_INTEL 1
163 #endif
164#endif
165
166//==============================================================================
167// Compiler type macros.
168
169#if defined (__clang__)
170 #define JUCE_CLANG 1
171
172#elif defined (__GNUC__)
173 #define JUCE_GCC 1
174
175#elif defined (_MSC_VER)
176 #define JUCE_MSVC 1
177
178#else
179 #error unknown compiler
180#endif