diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-02-22 02:22:21 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-04-07 16:17:11 +0000 |
commit | 1f235ad0364887beabd93c1210ed0c9a4f57fb3b (patch) | |
tree | 5c4636e498b76e8325994162c1b6464a978da549 | |
parent | 5f60181cf089de079bbbad030f664a3e24baf4ff (diff) |
Build sal on macOS.
-rw-r--r-- | meson.build | 34 | ||||
-rw-r--r-- | sal/meson.build | 76 |
2 files changed, 74 insertions, 36 deletions
diff --git a/meson.build b/meson.build index 93361389623f..a48c0256c3e1 100644 --- a/meson.build +++ b/meson.build @@ -13,6 +13,7 @@ cpp = meson.get_compiler('cpp') thread_dep = dependency('threads') dl_dep = cpp.find_library('dl', required: false) cdata = configuration_data() +osx_frameworks_dep = [] if host_machine.system() == 'linux' add_global_arguments('-DLINUX', language: 'cpp') @@ -46,6 +47,39 @@ elif host_machine.system() == 'windows' subdir('config_host') subdir('sal') subdir_done() +elif host_machine.system() == 'darwin' + add_languages('objcpp') + osx_frameworks_dep = [dependency('Carbon', method: 'extraframework'), + dependency('CoreFoundation', method: 'extraframework'), + dependency('Foundation', method: 'extraframework')] + + # HACK: just random values thrown in to make + # sal compile. OSX only. + add_global_arguments('-DMACOSX', language: 'objcpp') + add_global_arguments('-DMACOSX', language: 'cpp') + add_global_arguments('-DMACOSX', language: 'c') + add_global_arguments('-DUNIX', language: 'objcpp') + add_global_arguments('-DUNIX', language: 'cpp') + add_global_arguments('-DUNIX', language: 'c') + add_global_arguments('-DUNX', language: 'objccpp') + add_global_arguments('-DUNX', language: 'cpp') + add_global_arguments('-DUNX', language: 'c') + add_global_arguments('-DX86_64', language: 'objcpp') + add_global_arguments('-DX86_64', language: 'cpp') + add_global_arguments('-DX86_64', language: 'c') + #add_global_arguments('-DCPPU_ENV=gcc3', language: 'cpp') + rtl_os = 'macosx' + cppunit_dep = dependency('', required: false) + openssl_dep = cppunit_dep + nss_dep = cppunit_dep + cairo_dep = cppunit_dep + eot_dep = cppunit_dep + gtk3_dep = cppunit_dep + dbus_dep = cppunit_dep + gio_dep = cppunit_dep + subdir('config_host') + subdir('sal') + subdir_done() else error('Unsupported OS.') endif diff --git a/sal/meson.build b/sal/meson.build index aeea4279a187..eaa353c142ef 100644 --- a/sal/meson.build +++ b/sal/meson.build @@ -1,3 +1,36 @@ +unix_common = [ + 'osl/unx/backtraceapi.cxx', + 'osl/unx/conditn.cxx', + 'osl/unx/file.cxx', + 'osl/unx/file_error_transl.cxx', + 'osl/unx/file_misc.cxx', + 'osl/unx/file_path_helper.cxx', + 'osl/unx/file_stat.cxx', + 'osl/unx/file_url.cxx', + 'osl/unx/file_volume.cxx', + 'osl/unx/interlck.cxx', + 'osl/unx/memory.cxx', + 'osl/unx/module.cxx', + 'osl/unx/mutex.cxx', + 'osl/unx/nlsupport.cxx', + 'osl/unx/pipe.cxx', + 'osl/unx/process.cxx', + 'osl/unx/process_impl.cxx', + 'osl/unx/profile.cxx', + 'osl/unx/random.cxx', + 'osl/unx/readwrite_helper.cxx', + 'osl/unx/salinit.cxx', + 'osl/unx/security.cxx', + 'osl/unx/signal.cxx', + 'osl/unx/socket.cxx', + 'osl/unx/soffice.cxx', + 'osl/unx/tempfile.cxx', + 'osl/unx/thread.cxx', + 'osl/unx/time.cxx', + 'osl/unx/uunxapi.cxx', +] + + if host_machine.system() == 'windows' system_sources = [ 'osl/w32/backtrace.cxx', @@ -27,40 +60,11 @@ if host_machine.system() == 'windows' 'osl/w32/signal.cxx', ] system_link_args = ['ws2_32.lib', 'Mpr.lib', 'userenv.lib', 'Dbghelp.lib', 'Wer.lib'] +elif host_machine.system() == 'darwin' + system_sources = unix_common + ['osl/unx/osxlocale.cxx', 'osl/unx/system.mm'] + system_link_args = [] else - system_sources = [ - 'osl/unx/backtraceapi.cxx', - 'osl/unx/conditn.cxx', - 'osl/unx/file.cxx', - 'osl/unx/file_error_transl.cxx', - 'osl/unx/file_misc.cxx', - 'osl/unx/file_path_helper.cxx', - 'osl/unx/file_stat.cxx', - 'osl/unx/file_url.cxx', - 'osl/unx/file_volume.cxx', - 'osl/unx/interlck.cxx', - 'osl/unx/memory.cxx', - 'osl/unx/module.cxx', - 'osl/unx/mutex.cxx', - 'osl/unx/nlsupport.cxx', -# 'osl/unx/osxlocale.cxx', - 'osl/unx/pipe.cxx', - 'osl/unx/process.cxx', - 'osl/unx/process_impl.cxx', - 'osl/unx/profile.cxx', - 'osl/unx/random.cxx', - 'osl/unx/readwrite_helper.cxx', - 'osl/unx/salinit.cxx', - 'osl/unx/security.cxx', - 'osl/unx/signal.cxx', - 'osl/unx/socket.cxx', - 'osl/unx/soffice.cxx', - 'osl/unx/system.cxx', - 'osl/unx/tempfile.cxx', - 'osl/unx/thread.cxx', - 'osl/unx/time.cxx', - 'osl/unx/uunxapi.cxx', - ] + system_sources = unix_common + ['osl/unx/system.cxx'] system_link_args = [] endif @@ -119,13 +123,13 @@ sal_lib = shared_library('sal', 'textenc/textenc.cxx', 'textenc/unichars.cxx', include_directories: [main_inc, 'inc'], - cpp_args: ['-DSRCDIR="{}"'.format(meson.current_source_dir()), - '-DRTL_OS="{}"'.format(rtl_os), + cpp_args: ['-DSRCDIR="@0@"'.format(meson.current_source_dir()), + '-DRTL_OS="@0@"'.format(rtl_os), '-DRTL_ARCH="x86_64"', '-DLIBO_INTERNAL_ONLY', '-DSAL_DLLIMPLEMENTATION'], link_args: system_link_args, - dependencies: [thread_dep, dl_dep] + dependencies: [thread_dep, osx_frameworks_dep, dl_dep] ) if cppunit_dep.found() |