Skip to contentSkip to conversation

buildsys: Only display Objective-C information when Objective-C is used

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Oct 9, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 buildsys: Only display Objective-C information when Objective-C is used

When configuring with '--disable-cocoa --disable-coreaudio' on Darwin, we get:

meson.build:4081:58: ERROR: Tried to access compiler for language "objc", not specified for host machine. meson.build:4097:47: ERROR: Tried to access unknown option 'objc_args'.

Instead of unconditionally display Objective-C informations on Darwin, display them when Objective-C is discovered.

---
v2: Emit 'false' (Akihiko)

---
 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
index 3bb64b536c..567c1c9add 100644
@@ -4074,8 +4074,10 @@ if 'cpp' in all_languages
 else
   summary_info += {'C++ compiler':      false}
 endif
-if targetos == 'darwin'
+if 'objc' in all_languages
   summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
+else
+  summary_info += {'Objective-C compiler': false}
 endif
 option_cflags = (get_option('debug') ? ['-g'] : [])
 if get_option('optimization') != 'plain'
@@ -4085,7 +4087,7 @@ summary_info += {'CFLAGS':            ' '.join(get_option('c_args') + option_cfl
 if 'cpp' in all_languages
   summary_info += {'CXXFLAGS':        ' '.join(get_option('cpp_args') + option_cflags)}
 endif
-if targetos == 'darwin'
+if 'objc' in all_languages
   summary_info += {'OBJCFLAGS':       ' '.join(get_option('objc_args') + option_cflags)}
 endif
 link_args = get_option('c_link_args')
Signature · 1 line
2.41.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 33 lines · Philippe Mathieu-Daudé

When configuring with '--disable-cocoa --disable-coreaudio' on Darwin, we get:

meson.build:4081:58: ERROR: Tried to access compiler for language "objc", not specified for host machine. meson.build:4097:47: ERROR: Tried to access unknown option 'objc_args'.

Instead of unconditionally display Objective-C informations on Darwin, display them when Objective-C is discovered.

---
v2: Emit 'false' (Akihiko)

---
  meson.build | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +3 -1
index 3bb64b536c..567c1c9add 100644
@@ -4074,8 +4074,10 @@ if 'cpp' in all_languages
  else
    summary_info += {'C++ compiler':      false}
  endif
-if targetos == 'darwin'
+if 'objc' in all_languages
    summary_info += {'Objective-C compiler': ' '.join(meson.get_compiler('objc').cmd_array())}
+else
+  summary_info += {'Objective-C compiler': false}
  endif
  option_cflags = (get_option('debug') ? ['-g'] : [])
  if get_option('optimization') != 'plain'

meson.build summary_info += {'CFLAGS': ' '.join(get_option('c_args') + option_cfl · line 4093

Quoted 8 lines
meson.build +1 -1
@@ -4085,7 +4087,7 @@ summary_info += {'CFLAGS':            ' '.join(get_option('c_args') + option_cfl
  if 'cpp' in all_languages
    summary_info += {'CXXFLAGS':        ' '.join(get_option('cpp_args') + option_cflags)}
  endif
-if targetos == 'darwin'
+if 'objc' in all_languages
    summary_info += {'OBJCFLAGS':       ' '.join(get_option('objc_args') + option_cflags)}
  endif
  link_args = get_option('c_link_args')