Skip to content

Commit 75079bc

Browse files
committed
meson: add macos specific tweaks
Treat files as Objective-C++ instead of C++ because some included macos headers are Objective-C++ Objective-C++ apparently is a superset of C++ so we should be all good
1 parent bc20719 commit 75079bc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

meson.build

+10-4
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,16 @@ if host_machine.system() == 'linux'
262262
subdir: 'openframeworks'
263263
)
264264

265+
elif host_machine.system() == 'darwin'
266+
267+
deps += [dependency('appleframeworks', modules : ['AppKit', 'Foundation', 'AVKit', 'GLKit'])]
268+
add_project_arguments('-ObjC++', language: 'cpp')
269+
265270
endif
266271

267-
# We need to treat this dependency independently
272+
# We need to treat this dependency independently
268273
# because if it's not installed in the host system,
269-
# we will use the .wrap file in the subprojects file AND
274+
# we will use the .wrap file in the subprojects file AND
270275
# need to change a define in the cmake subproject
271276
uriparser_dep = dependency('uriparser', required: false)
272277
if not uriparser_dep.found()
@@ -298,7 +303,7 @@ freeimage_dep = compiler.find_library('freeimage', has_headers: ['FreeImage.h'],
298303
if not freeimage_dep.found()
299304
freeimage_opts = cmake.subproject_options()
300305
# doesn't compile with the define bellow
301-
# freeimage_opts.add_cmake_defines({'BUILD_SHARED_LIBS': true})
306+
# freeimage_opts.add_cmake_defines({'BUILD_SHARED_LIBS': true})
302307
# We need -fPIC to link against the produced static library
303308
freeimage_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': true})
304309
freeimage_proj = cmake.subproject('freeimage', options: freeimage_opts)
@@ -311,7 +316,8 @@ lib = library('openFrameworks',
311316
sources,
312317
include_directories: inc,
313318
dependencies: deps,
314-
install: true)
319+
install: true,
320+
)
315321

316322
openframeworks_dep = declare_dependency(link_with: lib, include_directories: inc, dependencies: deps)
317323

0 commit comments

Comments
 (0)