Skip to content

Commit e5f7b4d

Browse files
Add Gyp build files for OSX, Windows and Linux (desktop-only for now)
1 parent f8a87fd commit e5f7b4d

33 files changed

+3027
-2
lines changed

common.gypi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
# Common gyp inclusions for LiveCode
3+
'includes':
4+
[
5+
'config/configurations.gypi',
6+
'config/exclusions.gypi',
7+
'config/revolution.gypi',
8+
'config/target_os.gypi',
9+
'config/thirdparty.gypi',
10+
],
11+
}
12+

config/configurations.gypi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
'target_defaults':
3+
{
4+
'variables':
5+
{
6+
'server_mode': 0,
7+
},
8+
9+
'configurations':
10+
{
11+
'Debug':
12+
{
13+
14+
},
15+
16+
'Release':
17+
{
18+
19+
},
20+
},
21+
},
22+
}

config/exclusions.gypi

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
# Patterns to exclude platform-specific files
3+
'target_defaults':
4+
{
5+
'conditions':
6+
[
7+
[
8+
'OS != "win"',
9+
{
10+
'sources/':
11+
[
12+
['exclude', '_w32\\.cpp$'],
13+
['exclude', '(^|/)w32.+\\.cpp$'],
14+
],
15+
},
16+
{
17+
'sources/':
18+
[
19+
['exclude', '_posix\\.cpp$'],
20+
],
21+
},
22+
],
23+
[
24+
'OS != "mac"',
25+
{
26+
'sources/':
27+
[
28+
['exclude', '_osx\\.cpp$'],
29+
['exclude', '(^|/)osx.+\\.cpp$'],
30+
],
31+
},
32+
],
33+
[
34+
'OS != "linux"',
35+
{
36+
'sources/':
37+
[
38+
['exclude', '_lnx\\.cpp$'],
39+
['exclude', '(^|/)lnx.+\\.cpp$'],
40+
['exclude', '(^|/)unx.+\\.cpp$'],
41+
],
42+
},
43+
],
44+
[
45+
'OS != "android"',
46+
{
47+
'sources/':
48+
[
49+
['exclude', '_android.cpp$'],
50+
['exclude', '(^|/)mblandroid.*\\.cpp$'],
51+
['exclude', '\\.java$'],
52+
],
53+
},
54+
],
55+
[
56+
'OS != "ios"',
57+
{
58+
'sources/':
59+
[
60+
['exclude', '_ios\\.(cpp|mm)$'],
61+
['exclude', '(^|/)mbliphone.*\\.(cpp|mm)$'],
62+
],
63+
},
64+
],
65+
[
66+
'OS != "android" and OS != "ios"',
67+
{
68+
'sources/':
69+
[
70+
['exclude', '(^|/)mbl.+\\.cpp$'],
71+
],
72+
},
73+
],
74+
[
75+
'OS != "mac" and OS != "ios"',
76+
{
77+
'sources/':
78+
[
79+
['exclude', '\\.m(m?)$'],
80+
],
81+
},
82+
],
83+
],
84+
},
85+
}

config/linux.gypi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
'target_defaults':
3+
{
4+
'defines':
5+
[
6+
'_LINUX',
7+
'LINUX',
8+
'X11',
9+
'GTKTHEME',
10+
'HAVE___THREAD',
11+
'TARGET_PLATFORM_LINUX',
12+
'TARGET_PLATFORM_POSIX',
13+
'_FILE_OFFSET_BITS=64',
14+
],
15+
16+
# We supply some pre-packaged headers for Linux libraries
17+
'include_dirs':
18+
[
19+
'../thirdparty/headers/linux/include',
20+
],
21+
},
22+
}

config/mac.gypi

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
'xcode_config_file': '../version',
3+
4+
'xcode_settings':
5+
{
6+
'SDKROOT': 'macosx10.8',
7+
8+
'SOLUTION_DIR': '<(DEPTH)',
9+
'SYMROOT': '$(SOLUTION_DIR)/_build/mac',
10+
'OBJROOT': '$(SOLUTION_DIR)/_cache/mac',
11+
'CONFIGURATION_BUILD_DIR': '$(SYMROOT)/$(CONFIGURATION)',
12+
'CONFIGURATION_TEMP_DIR': '$(OBJROOT)/$(CONFIGURATION)',
13+
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
14+
'GCC_ENABLE_CPP_RTTI': 'NO',
15+
'GCC_THREADSAFE_STATICS': 'NO',
16+
'SHARED_PRECOMPS_DIR': '$(OBJROOT)/Precompiled/$(CURRENT_ARCH)',
17+
'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'NO',
18+
'ALWAYS_SEARCH_USER_PATHS': 'NO',
19+
'MACOSX_DEPLOYMENT_TARGET': '10.6',
20+
},
21+
22+
'target_defaults':
23+
{
24+
'defines':
25+
[
26+
'TARGET_PLATFORM_MACOS_X',
27+
'_MACOSX',
28+
],
29+
30+
'configurations':
31+
{
32+
'Debug':
33+
{
34+
'defines':
35+
[
36+
'_DEBUG',
37+
],
38+
},
39+
40+
'Release':
41+
{
42+
'defines':
43+
[
44+
'_RELEASE',
45+
'NDEBUG',
46+
],
47+
},
48+
},
49+
},
50+
51+
'configurations':
52+
{
53+
'Debug':
54+
{
55+
'xcode_settings':
56+
{
57+
'ARCHS': 'i386',
58+
'COPY_PHASE_STRIP': 'NO',
59+
'GCC_OPTIMIZATION_LEVEL': '0',
60+
},
61+
},
62+
63+
'Release':
64+
{
65+
'xcode_settings':
66+
{
67+
'ARCHS': 'i386',
68+
'GCC_OPTIMIZATION_LEVEL': '3',
69+
'GCC_ENABLE_FIX_AND_CONTINUE': 'NO',
70+
},
71+
},
72+
},
73+
}

config/revolution.gypi

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
'variables':
3+
{
4+
'conditions':
5+
[
6+
# Location of the prebuilt engine
7+
[
8+
'OS == "mac" or OS == "ios" or OS == "android"',
9+
{
10+
'revolution_path': '../prebuilt/bin/Revolution.osx',
11+
'perfect_path': '../prebuilt/bin/perfect.osx',
12+
},
13+
],
14+
[
15+
'OS == "win"',
16+
{
17+
'revolution_path': '$(SolutionDir)/../prebuilt/bin/Revolution.exe',
18+
'perfect_path': '$(SolutionDir)/../prebuilt/bin/perfect.exe',
19+
},
20+
],
21+
[
22+
'OS == "linux"',
23+
{
24+
'revolution_path': '../prebuilt/bin/Revolution.lnx',
25+
'perfect_path': '../prebuilt/bin/perfect.lnx',
26+
},
27+
],
28+
],
29+
},
30+
}

config/target_os.gypi

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
'conditions':
3+
[
4+
[
5+
'OS == "mac"',
6+
{
7+
'includes':
8+
[
9+
'mac.gypi',
10+
],
11+
},
12+
],
13+
[
14+
'OS == "linux"',
15+
{
16+
'includes':
17+
[
18+
'linux.gypi',
19+
],
20+
},
21+
],
22+
[
23+
'OS == "win"',
24+
{
25+
'includes':
26+
[
27+
'win32.gypi',
28+
],
29+
},
30+
],
31+
],
32+
}

config/thirdparty.gypi

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
# Control over using system-provided thirdparty libs or our own
3+
'variables':
4+
{
5+
'use_system_libcairo%': 0,
6+
'use_system_libcef%': 0,
7+
'use_system_libcurl%': 0,
8+
'use_system_libexpat%': 0,
9+
'use_system_libfreetype%': 0,
10+
'use_system_libgif%': 0,
11+
'use_system_libiodbc%': 0,
12+
'use_system_libjpeg%': 0,
13+
'use_system_libmysql%': 0,
14+
'use_system_libopenssl%': 0,
15+
'use_system_libpcre%': 0,
16+
'use_system_libpng%': 0,
17+
'use_system_libpq%': 0,
18+
'use_system_libskia%': 0,
19+
'use_system_libsqlite%': 0,
20+
'use_system_libxml%': 0,
21+
'use_system_libxslt%': 0,
22+
'use_system_libz%': 0,
23+
'use_system_libzip%': 0,
24+
},
25+
}

0 commit comments

Comments
 (0)