And migrated the last missing bit from the CMakeLists.txt into meson.build; thanks to someone from freenode #mesonbuild. No more CMake files!

This commit is contained in:
Pietro Gagliardi 2019-03-28 20:18:05 -04:00
parent 81e25f76f2
commit d62775ad02
2 changed files with 20 additions and 17 deletions

View File

@ -1,16 +0,0 @@
# 3 june 2016
# flags for warning on undefined symbols
# TODO figure out why FreeBSD follows linked libraries here
# TODO figure out MSVC equivalents
if(BUILD_SHARED_LIBS)
if(NOT (${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD))
# on OS X we don't need to do this; Apple's linker warns about undefined symbols in -shared builds!
if(NOT APPLE)
target_link_libraries(libui
PRIVATE -Wl,--no-undefined -Wl,--no-allow-shlib-undefined
)
endif()
endif()
endif()
endif()

View File

@ -116,7 +116,7 @@ else
endif
endif
# TODO come up with a better way to do this, both for libui (the compiler define, used by winapi.hpp, and the manifest args) and for the binaries (the manifest args)
# TODO come up with a better way to do this, both for libui (the compiler define, used by winapi.hpp, and the manifest args) and for the binaries (the manifest args); then move that below the part below that actually adds these arguments
libui_manifest_args = []
if libui_mode == 'static'
libui_project_compile_args += ['-D_UI_STATIC']
@ -128,6 +128,24 @@ add_project_arguments(libui_project_compile_args,
add_project_link_arguments(libui_project_link_args,
language: ['c', 'cpp', 'objc'])
# TODO:
# meson determins whether -Wl,--no-undefined is provided via
# built-in option b_lundef, and it's true by default, which is what
# we want (so I don't make mistakes like asking for unknown
# functions in my dependencies). However, meson also is smart
# about specifying this properly on systems that don't support it, like
# FreeBSD (where I had the comment "figure out why FreeBSD
# follows linked libraries here" when I was on cmake) and OpenBSD
# (according to someone on freenode #mesonbuild), but it isn't clear
# whether it's just ignored or if the value is forced to false.
# Therefore, once this is determined, we can uncomment the
# following.
libui_libui_link_args = []
#if not libui_MSVC and get_option("b_lundef")
# TODO what should this be on MSVC?
# libui_libui_link_args += ['-Wl,--no-allow-shlib-undefined']
#endif
libui_sources = []
libui_deps = []
libui_soversion = ''
@ -153,6 +171,7 @@ libui_libui = library('ui', libui_sources,
c_args: ['-Dlibui_EXPORTS'],
cpp_args: ['-Dlibui_EXPORTS'],
objc_args: ['-Dlibui_EXPORTS'],
link_args: libui_libui_link_args,
soversion: libui_soversion,
darwin_versions: []) # TODO
install_headers('ui.h')