-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Julia DeMille <[email protected]>
- Loading branch information
Showing
6 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
project( | ||
'x-plane-sdk', | ||
'c', | ||
version: '4.0.1', | ||
license: 'MIT', | ||
default_options: 'warning_level=0', | ||
) | ||
|
||
xplm_incdir = include_directories('SDK/CHeaders/XPLM') | ||
widgets_incdir = include_directories('SDK/CHeaders/Widgets') | ||
wrappers_incdir = include_directories('SDK/CHeaders/Wrappers') | ||
|
||
cc = meson.get_compiler('c') | ||
|
||
ca = [] | ||
xplm_level = get_option('xplm_level') | ||
|
||
if xplm_level >= 200 | ||
ca += '-DXPLM200' | ||
endif | ||
|
||
if xplm_level >= 210 | ||
ca += '-DXPLM210' | ||
endif | ||
|
||
if xplm_level >= 300 | ||
ca += '-DXPLM300' | ||
endif | ||
|
||
if xplm_level >= 301 | ||
ca += '-DXPLM301' | ||
endif | ||
|
||
if xplm_level >= 303 | ||
ca += '-DXPLM303' | ||
endif | ||
|
||
if xplm_level >= 400 | ||
ca += '-DXPLM400' | ||
endif | ||
|
||
if target_machine.system() == 'windows' | ||
ca += ['-DAPL=0', '-DIBM=1', '-DLIN=0'] | ||
xplm_dep = declare_dependency( | ||
compile_args: ca, | ||
include_directories: [xplm_incdir], | ||
dependencies: [ | ||
cc.find_library( | ||
'XPLM_64', | ||
dirs: [meson.current_source_dir() / 'SDK' / 'Libraries' / 'Win'], | ||
), | ||
], | ||
) | ||
xpwidgets_dep = declare_dependency( | ||
compile_args: ca, | ||
include_directories: [widgets_incdir], | ||
dependencies: [ | ||
xplm_dep, | ||
cc.find_library( | ||
'XPWidgets_64', | ||
dirs: [meson.current_source_dir() / 'SDK' / 'Libraries' / 'Win'], | ||
), | ||
], | ||
) | ||
elif target_machine.system() == 'darwin' | ||
ca += ['-DAPL=1', '-DIBM=0', '-DLIN=0'] | ||
xplm_dep = declare_dependency( | ||
compile_args: ca, | ||
link_args: [ | ||
'-F' + meson.current_source_dir() / 'SDK' / 'Libraries' / 'Mac', | ||
'-framework', | ||
'XPLM', | ||
], | ||
include_directories: [xplm_incdir], | ||
) | ||
xpwidgets_dep = declare_dependency( | ||
compile_args: ca, | ||
link_args: [ | ||
'-F' + meson.current_source_dir() / 'SDK' / 'Libraries' / 'Mac', | ||
'-framework', | ||
'XPWidgets', | ||
], | ||
include_directories: [widgets_incdir], | ||
dependencies: [xplm_dep], | ||
) | ||
else | ||
ca += ['-DAPL=0', '-DIBM=0', '-DLIN=1'] | ||
xplm_dep = declare_dependency( | ||
compile_args: ca, | ||
include_directories: [xplm_incdir], | ||
) | ||
xpwidgets_dep = declare_dependency( | ||
compile_args: ca, | ||
include_directories: [widgets_incdir], | ||
dependencies: [xplm_dep], | ||
) | ||
endif | ||
|
||
if get_option('cpp').enabled() | ||
add_languages('cpp') | ||
xpcpp_dir = 'SDK/CHeaders/Wrappers' | ||
# There is no reason to make this a dynamic library. | ||
# Static is the only sensible choice for this particular library. | ||
xpcpp = static_library( | ||
'xpcpp', | ||
cpp_args: ca, | ||
include_directories: [wrappers_incdir], | ||
pic: true, | ||
dependencies: [xplm_dep, xpwidgets_dep], | ||
sources: [ | ||
xpcpp_dir / 'XPCBroadcaster.cpp', | ||
xpcpp_dir / 'XPCDisplay.cpp', | ||
xpcpp_dir / 'XPCListener.cpp', | ||
xpcpp_dir / 'XPCProcessing.cpp', | ||
xpcpp_dir / 'XPCWidgetAttachments.cpp', | ||
xpcpp_dir / 'XPCWidget.cpp', | ||
], | ||
) | ||
|
||
xpcpp_dep = declare_dependency( | ||
compile_args: ca, | ||
dependencies: [xplm_dep, xpwidgets_dep], | ||
include_directories: [wrappers_incdir], | ||
link_with: [xpcpp], | ||
) | ||
else | ||
xpcpp_dep = disabler() | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
option('xplm_level', type: 'integer', min: 0, max: 400, value: 0, | ||
description: 'The XPLM compatibility level to use. See the documentation.') | ||
option('cpp', type: 'feature', value: 'disabled', | ||
description: 'Build C++ wrappers') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[wrap-file] | ||
directory = x-plane-sdk-4.0.1 | ||
source_url = https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sample_templates/XPSDK401.zip | ||
source_filename = x-plane-sdk-4.0.1.zip | ||
source_hash = c1104e83d9b54b03d0084c1db52ee6491e5290994503e8dd2d4a0af637e2bdd7 | ||
patch_directory = x-plane-sdk | ||
lead_directory_missing = true | ||
|
||
[provide] | ||
xplm = xplm_dep | ||
xpwidgets = xpwidgets_dep | ||
xpcpp = xpcpp_dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters