OpenShot Audio Library | OpenShotAudio: juce_TargetPlatform.h Source File

OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
juce_TargetPlatform.h
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#ifdef JUCE_APP_CONFIG_HEADER
40 #include JUCE_APP_CONFIG_HEADER
41#elif ! defined (JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED)
42 /*
43 Most projects will contain a global header file containing various settings that
44 should be applied to all the code in your project. If you use the projucer, it'll
45 set up a global header file for you automatically, but if you're doing things manually,
46 you may want to set the JUCE_APP_CONFIG_HEADER macro with the name of a file to include,
47 or just include one before all the module cpp files, in which you set
48 JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 to silence this error.
49 (Or if you don't need a global header, then you can just define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED
50 globally to avoid this error).
51
52 Note for people who hit this error when trying to compile a JUCE project created by
53 a pre-v4.2 version of the Introjucer/Projucer, it's very easy to fix: just re-save
54 your project with the latest version of the Projucer, and it'll magically fix this!
55 */
56 #error "No global header file was included!"
57#endif
58
59//==============================================================================
60#if defined (_WIN32) || defined (_WIN64)
61 #define JUCE_WINDOWS 1
62#elif defined (JUCE_ANDROID)
63 #undef JUCE_ANDROID
64 #define JUCE_ANDROID 1
65#elif defined (__FreeBSD__) || defined (__OpenBSD__)
66 #define JUCE_BSD 1
67#elif defined (LINUX) || defined (__linux__)
68 #define JUCE_LINUX 1
69#elif defined (__APPLE_CPP__) || defined (__APPLE_CC__)
70 #define CF_EXCLUDE_CSTD_HEADERS 1
71 #include <TargetConditionals.h> // (needed to find out what platform we're using)
72 #include <AvailabilityMacros.h>
73
74 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
75 #define JUCE_IPHONE 1
76 #define JUCE_IOS 1
77 #else
78 #define JUCE_MAC 1
79 #endif
80#elif defined (__wasm__)
81 #define JUCE_WASM 1
82#else
83 #error "Unknown platform!"
84#endif
85
86//==============================================================================
87#if JUCE_WINDOWS
88 #ifdef _MSC_VER
89 #ifdef _WIN64
90 #define JUCE_64BIT 1
91 #else
92 #define JUCE_32BIT 1
93 #endif
94 #endif
95
96 #ifdef _DEBUG
97 #define JUCE_DEBUG 1
98 #endif
99
100 #ifdef __MINGW32__
101 #define JUCE_MINGW 1
102 #ifdef __MINGW64__
103 #define JUCE_64BIT 1
104 #else
105 #define JUCE_32BIT 1
106 #endif
107 #endif
108
110 #define JUCE_LITTLE_ENDIAN 1
111
112 #if defined (_M_ARM) || defined (_M_ARM64) || defined (__arm__) || defined (__aarch64__)
113 #define JUCE_ARM 1
114 #else
115 #define JUCE_INTEL 1
116 #endif
117#endif
118
119//==============================================================================
120#if JUCE_MAC || JUCE_IOS
121
122 #if defined (DEBUG) || defined (_DEBUG) || ! (defined (NDEBUG) || defined (_NDEBUG))
123 #define JUCE_DEBUG 1
124 #endif
125
126 #if ! (defined (DEBUG) || defined (_DEBUG) || defined (NDEBUG) || defined (_NDEBUG))
127 #warning "Neither NDEBUG or DEBUG has been defined - you should set one of these to make it clear whether this is a release build,"
128 #endif
129
130 #ifdef __LITTLE_ENDIAN__
131 #define JUCE_LITTLE_ENDIAN 1
132 #else
133 #define JUCE_BIG_ENDIAN 1
134 #endif
135
136 #ifdef __LP64__
137 #define JUCE_64BIT 1
138 #else
139 #define JUCE_32BIT 1
140 #endif
141
142 #if defined (__ppc__) || defined (__ppc64__)
143 #error "PowerPC is no longer supported by JUCE!"
144 #elif defined (__arm__) || defined (__arm64__)
145 #define JUCE_ARM 1
146 #else
147 #define JUCE_INTEL 1
148 #endif
149
150 #if JUCE_MAC
151 #if ! defined (MAC_OS_X_VERSION_10_14)
152 #error "The 10.14 SDK (Xcode 10.1+) is required to build JUCE apps. You can create apps that run on macOS 10.9+ by changing the deployment target."
153 #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
154 #error "Building for OSX 10.8 and earlier is no longer supported!"
155 #endif
156 #endif
157#endif
158
159//==============================================================================
160#if JUCE_LINUX || JUCE_ANDROID || JUCE_BSD
161
162 #ifdef _DEBUG
163 #define JUCE_DEBUG 1
164 #endif
165
166 // Allow override for big-endian Linux platforms
167 #if defined (__LITTLE_ENDIAN__) || ! defined (JUCE_BIG_ENDIAN)
168 #define JUCE_LITTLE_ENDIAN 1
169 #undef JUCE_BIG_ENDIAN
170 #else
171 #undef JUCE_LITTLE_ENDIAN
172 #define JUCE_BIG_ENDIAN 1
173 #endif
174
175 #if defined (__LP64__) || defined (_LP64) || defined (__arm64__)
176 #define JUCE_64BIT 1
177 #else
178 #define JUCE_32BIT 1
179 #endif
180
181 #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
182 #define JUCE_ARM 1
183 #elif __MMX__ || __SSE__ || __amd64__
184 #define JUCE_INTEL 1
185 #endif
186#endif
187
188//==============================================================================
189// Compiler type macros.
190
191#if defined (__clang__)
192 #define JUCE_CLANG 1
193
194#elif defined (__GNUC__)
195 #define JUCE_GCC 1
196
197#elif defined (_MSC_VER)
198 #define JUCE_MSVC 1
199
200#else
201 #error unknown compiler
202#endif