Moved the binary PIC as a TODO and marked merge blockers as MESONTODO. Also removed a stale cmake-era TODO, because the manifest distribution idea it had will eventually be part of the uires tool.

This commit is contained in:
Pietro Gagliardi 2019-03-27 21:34:09 -04:00
parent 70fe716d06
commit 81e25f76f2
6 changed files with 16 additions and 21 deletions

View File

@ -14,8 +14,3 @@
endif()
endif()
endif()
macro(_add_exec _name)
set_property(TARGET ${_name} PROPERTY
POSITION_INDEPENDENT_CODE True)
endmacro()

View File

@ -50,6 +50,7 @@ libui_examples = {
},
}
foreach name, args : libui_examples
# TODO once we upgrade to 0.49.0, add pie: true
executable(name, args['sources'] + libui_example_sources,
dependencies: args.get('deps', []) + libui_binary_deps,
link_with: libui_libui,
@ -60,4 +61,4 @@ foreach name, args : libui_examples
install: false)
endforeach
# TODO define the top-level examples target here
# MESONTODO define the top-level examples target here

View File

@ -7,24 +7,24 @@
# [--layout=flat] \ (useful for distribution and Windows DLL tests)
# [--b_sanitize=whatever]
# It turns out that I wouldn't really need any custom options; go figure.
# TODO I'm not sure how to allow building 32-bit instead of 64-bit with meson.
# TODO figure out what (meson/ninja) dist do
# TODO figure out why test and examples aren't included in ninja all
# TODO figure out how to make an overarching "examples" target
# TODOs from cmake; not sure if they're relevant here:
# MESONTODO I'm not sure how to allow building 32-bit instead of 64-bit with meson.
# MESONTODO figure out what (meson/ninja) dist do
# MESONTODO figure out why test and examples aren't included in ninja all
# MESONTODO figure out how to make an overarching "examples" target
# MESONTODOs from cmake; not sure if they're relevant here:
# - uname -s for more refined OS control
# - Haiku for haiku
# - debian DESTDIR? https://github.com/andlabs/libui/pull/10
# - disable incremental linking? I forget if meson already doesn't do this or not; we did it manually in cmake
# we have to specify C++ here even if we're not using C++ immediately because otherwise none of the C++ built-in options are available (sigh; TODO)
# we have to specify C++ here even if we're not using C++ immediately because otherwise none of the C++ built-in options are available (sigh; MESONTODO)
project('libui', ['c', 'cpp'],
meson_version: '>=0.48.0',
default_options: [
'buildtype=debug', # build debug by default
'default_library=shared', # build shared libraries by default
# these are forced options, but meson doesn't let me set these up separately before I call project() (TODO)
# these are forced options, but meson doesn't let me set these up separately before I call project() (MESONTODO)
'warning_level=3', # always max warnings
'b_pch=false', # we don't want precompiled headers
'b_staticpic=true', # use PIC even for static libraries
@ -36,7 +36,7 @@ project('libui', ['c', 'cpp'],
],
license: 'MIT')
# TODO move these below the next part (I need them here for other reasons)
# MESONTODO move these below the next part (I need them here for other reasons)
libui_OS = host_machine.system()
libui_MSVC = meson.get_compiler('c').get_id() == 'msvc'
@ -45,7 +45,7 @@ if libui_OS == 'darwin'
required: true)
endif
# TODO switch to tabs; the spaces are just so I can share this file while I'm writing it
# MESONTODO switch to tabs; the spaces are just so I can share this file while I'm writing it
libui_forced_options = {
'warning_level': '3', # always max warnings
'b_pch': 'false', # we don't want precompiled headers
@ -57,7 +57,7 @@ libui_forced_options = {
'cpp_winlibs': '[]', # likewise as with c_winlibs
}
foreach name, value : libui_forced_options
# TODO why does meson need this guard? why aren't all options defined regardless of target?!
# MESONTODO why does meson need this guard? why aren't all options defined regardless of target?!
if not ((name == 'c_winlibs' or name == 'cpp_eh' or name == 'cpp_winlibs') and not libui_MSVC) and not (name == 'c_std' and libui_MSVC)
actual = '@0@'.format(get_option(name))
if actual != value

View File

@ -39,7 +39,8 @@ if libui_OS == 'windows'
]
endif
# TODO meson doesn't let us name this target test, but also doesn't seem to provide a way to override the executable name????
# MESONTODO meson doesn't let us name this target test, but also doesn't seem to provide a way to override the executable name????
# TODO once we upgrade to 0.49.0, add pie: true
executable('tester', libui_test_sources,
dependencies: libui_binary_deps,
link_with: libui_libui,

View File

@ -52,7 +52,7 @@ libui_deps += [
version: '>=3.10.0',
method: 'pkg-config',
required: true),
# TODO are there better ways for these two?
# MESONTODO are there better ways for these two? I forget if I asked this already...
meson.get_compiler('c').find_library('m',
required: true),
meson.get_compiler('c').find_library('dl',

View File

@ -70,10 +70,8 @@ libui_sources += [
# For a DLL, we have to include this directly, so we do so.
# Windows won't link resources in static libraries, so including this would have no effect.
# In those cases, we just need them to include the manifest with the executable (or link it directly into the output executable themselves); they can also customize the manifest as they see fit (assuming nothing breaks in the process).
# TODO make sure this gets added to both binary-only archives and install rules in this case
if libui_mode == 'shared'
libui_sources += [
# TODO settle the path thing once and for all
windows.compile_resources('resources.rc',
args: libui_manifest_args,
depend_files: ['libui.manifest'],
@ -81,7 +79,7 @@ if libui_mode == 'shared'
endif
# TODO prune this list
# TODO find out if we can just pass libui_winlibs to find_library()
# MESONTODO find out if we can just pass libui_winlibs to find_library()
libui_winlibs = 'user32 kernel32 gdi32 comctl32 uxtheme msimg32 comdlg32 d2d1 dwrite ole32 oleaut32 oleacc uuid windowscodecs'.split(' ')
foreach lib : libui_winlibs
libui_deps += [