mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
Merge branch 'fix-buildtype-usage' into 'master'
meson: Fix buildtype usage See merge request GNOME/glib!1433
This commit is contained in:
commit
87cd6a4a19
@ -105,7 +105,7 @@ if not dbus1_dep.found()
|
|||||||
# MSVC: Search for the DBus library by the configuration, which corresponds
|
# MSVC: Search for the DBus library by the configuration, which corresponds
|
||||||
# to the output of CMake builds of DBus. Note that debugoptimized
|
# to the output of CMake builds of DBus. Note that debugoptimized
|
||||||
# is really a Release build with .PDB files.
|
# is really a Release build with .PDB files.
|
||||||
if buildtype == 'debug'
|
if vs_crt == 'debug'
|
||||||
dbus1_dep = cc.find_library('dbus-1d', required : false)
|
dbus1_dep = cc.find_library('dbus-1d', required : false)
|
||||||
else
|
else
|
||||||
dbus1_dep = cc.find_library('dbus-1', required : false)
|
dbus1_dep = cc.find_library('dbus-1', required : false)
|
||||||
|
24
meson.build
24
meson.build
@ -210,15 +210,27 @@ else
|
|||||||
endif
|
endif
|
||||||
glibconfig_conf.set('glib_os', glib_os)
|
glibconfig_conf.set('glib_os', glib_os)
|
||||||
|
|
||||||
# We need to know the build type to determine what .lib files we need on Visual Studio
|
# We need to know the CRT being used to determine what .lib files we need on
|
||||||
# for dependencies that don't normally come with pkg-config files for Visual Studio builds
|
# Visual Studio for dependencies that don't normally come with pkg-config files
|
||||||
buildtype = get_option('buildtype')
|
vs_crt = 'release'
|
||||||
|
vs_crt_opt = get_option('b_vscrt')
|
||||||
|
if vs_crt_opt in ['mdd', 'mtd']
|
||||||
|
vs_crt = 'debug'
|
||||||
|
elif vs_crt_opt == 'from_buildtype'
|
||||||
|
if get_option('buildtype') == 'debug'
|
||||||
|
vs_crt = 'debug'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Use debug/optimization flags to determine whether to enable debug or disable
|
||||||
|
# cast checks
|
||||||
glib_debug_cflags = []
|
glib_debug_cflags = []
|
||||||
if buildtype.startswith('debug')
|
if get_option('debug')
|
||||||
glib_debug_cflags += ['-DG_ENABLE_DEBUG']
|
glib_debug_cflags += ['-DG_ENABLE_DEBUG']
|
||||||
elif buildtype == 'release'
|
message('Enabling various debug infrastructure')
|
||||||
|
elif get_option('optimization') in ['2', '3', 's']
|
||||||
glib_debug_cflags += ['-DG_DISABLE_CAST_CHECKS']
|
glib_debug_cflags += ['-DG_DISABLE_CAST_CHECKS']
|
||||||
|
message('Disabling cast checks')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_project_arguments(glib_debug_cflags, language: 'c')
|
add_project_arguments(glib_debug_cflags, language: 'c')
|
||||||
@ -1848,7 +1860,7 @@ else
|
|||||||
# MSVC: Search for the PCRE library by the configuration, which corresponds
|
# MSVC: Search for the PCRE library by the configuration, which corresponds
|
||||||
# to the output of CMake builds of PCRE. Note that debugoptimized
|
# to the output of CMake builds of PCRE. Note that debugoptimized
|
||||||
# is really a Release build with .PDB files.
|
# is really a Release build with .PDB files.
|
||||||
if buildtype == 'debug'
|
if vs_crt == 'debug'
|
||||||
pcre = cc.find_library('pcred', required : false)
|
pcre = cc.find_library('pcred', required : false)
|
||||||
else
|
else
|
||||||
pcre = cc.find_library('pcre', required : false)
|
pcre = cc.find_library('pcre', required : false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user