1// MIT License
2
3// Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com
4
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#pragma once
24
25#if !defined(TIC_BUILD_WITH_LUA) && \
26 !defined(TIC_BUILD_WITH_MOON) && \
27 !defined(TIC_BUILD_WITH_FENNEL) && \
28 !defined(TIC_BUILD_WITH_JS) && \
29 !defined(TIC_BUILD_WITH_WREN) && \
30 !defined(TIC_BUILD_WITH_SQUIRREL) && \
31 !defined(TIC_BUILD_WITH_WASM)
32
33# define TIC_BUILD_WITH_LUA 1
34# define TIC_BUILD_WITH_MOON 1
35# define TIC_BUILD_WITH_FENNEL 1
36# define TIC_BUILD_WITH_JS 1
37# define TIC_BUILD_WITH_WREN 1
38# define TIC_BUILD_WITH_SQUIRREL 1
39# define TIC_BUILD_WITH_WASM 1
40
41#endif
42
43#if defined(TIC_BUILD_WITH_FENNEL) || defined(TIC_BUILD_WITH_MOON)
44# define TIC_BUILD_WITH_LUA 1
45#endif
46
47#if defined(__APPLE__)
48// TODO: this disables macos config
49# include "AvailabilityMacros.h"
50# include "TargetConditionals.h"
51// # ifndef TARGET_OS_IPHONE
52# undef __TIC_MACOSX__
53# define __TIC_MACOSX__ 1
54// # endif /* TARGET_OS_IPHONE */
55#endif /* defined(__APPLE__) */
56
57#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
58# undef __TIC_WINDOWS__
59# define __TIC_WINDOWS__ 1
60#endif
61
62#if defined(ANDROID) || defined(__ANDROID__)
63# undef __TIC_ANDROID__
64# define __TIC_ANDROID__ 1
65#elif (defined(linux) || defined(__linux) || defined(__linux__))
66# undef __TIC_LINUX__
67# define __TIC_LINUX__ 1
68#endif
69
70#ifndef TIC80_API
71# if defined(TIC80_SHARED)
72# if defined(__TIC_WINDOWS__)
73# define TIC80_API __declspec(dllexport)
74# elif defined(__TIC_LINUX__)
75# define TIC80_API __attribute__ ((visibility("default")))
76# endif
77# else
78# define TIC80_API
79# endif
80#endif
81