Change ordering of meson file
Somehow the endif got messed up in our meson file, and seems to be
causing problems for clang builds. It seems that all of our configure
option checking got put under the "if gcc" branch, which it really
shouldn't be, as options apply to all compilers.
This commit simply moves all the debug, and option logic out into the
primary scope, which makes things build correctly.
Tested:
Built with gcc in yocto, and gave the same expected options as
previously (I specifically tested logging).
Tested compiling in yocto with every combination of:
DEBUG_BUILD_pn-bmcweb = "1"
TOOLCHAIN:pn-bmcweb = "clang"
All builds succeed
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9b9da321615920942489d1b2f070b011b01b5efe
diff --git a/meson.build b/meson.build
index 2b27e86..f2d8636 100644
--- a/meson.build
+++ b/meson.build
@@ -172,70 +172,70 @@
'-Wformat=2',
]),
language:'cpp')
+endif
- if (get_option('buildtype') != 'plain')
- if (get_option('b_lto') == true and get_option('optimization')!='0')
- # Reduce the binary size by removing unnecessary
- # dynamic symbol table entries
+if (get_option('buildtype') != 'plain')
+ if (get_option('b_lto') == true and get_option('optimization')!='0')
+ # Reduce the binary size by removing unnecessary
+ # dynamic symbol table entries
- add_project_arguments(
- cxx.get_supported_arguments([
- '-fno-fat-lto-objects',
- '-fvisibility=hidden',
- '-fvisibility-inlines-hidden'
- ]),
- language: 'cpp')
+ add_project_arguments(
+ cxx.get_supported_arguments([
+ '-fno-fat-lto-objects',
+ '-fvisibility=hidden',
+ '-fvisibility-inlines-hidden'
+ ]),
+ language: 'cpp')
- if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
- add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
- endif
- endif
-
- if( get_option('bmcweb-logging').enabled() or \
- get_option('buildtype').startswith('debug'))
- add_project_arguments([
- '-DBMCWEB_ENABLE_LOGGING',
- '-DBMCWEB_ENABLE_DEBUG'
- ],
- language : 'cpp')
-
- summary({'debug' :'-DBMCWEB_ENABLE_DEBUG',
- 'logging' : '-DBMCWEB_ENABLE_LOGGING',
- },section : 'Enabled Features')
- endif
-
- if( get_option('redfish-allow-deprecated-hostname-patch').enabled())
- add_project_arguments([
- '-DBMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH'
- ],
- language : 'cpp')
-
- summary({'hostname-patch' :'-DBMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH'
- },section : 'Enabled Features')
- endif
-
- if( get_option('redfish-allow-deprecated-power-thermal').enabled())
- add_project_arguments([
- '-DBMCWEB_ALLOW_DEPRECATED_POWER_THERMAL'
- ],
- language : 'cpp')
-
- summary({'power-thermal' :'-DBMCWEB_ALLOW_DEPRECATED_POWER_THERMAL'
- },section : 'Enabled Features')
- endif
-
- if( get_option('redfish-new-powersubsystem-thermalsubsystem').enabled())
- add_project_arguments([
- '-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM'
- ],
- language : 'cpp')
-
- summary({'new-powersubsystem-thermalsubsystem' :'-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM'
- },section : 'Enabled Features')
+ if cxx.has_link_argument('-Wl,--exclude-libs,ALL')
+ add_project_link_arguments('-Wl,--exclude-libs,ALL', language: 'cpp')
endif
endif
endif
+if( get_option('bmcweb-logging').enabled() or \
+ get_option('buildtype').startswith('debug'))
+ add_project_arguments([
+ '-DBMCWEB_ENABLE_LOGGING',
+ '-DBMCWEB_ENABLE_DEBUG'
+ ],
+ language : 'cpp')
+
+ summary({'debug' :'-DBMCWEB_ENABLE_DEBUG',
+ 'logging' : '-DBMCWEB_ENABLE_LOGGING',
+ },section : 'Enabled Features')
+endif
+
+if( get_option('redfish-allow-deprecated-hostname-patch').enabled())
+ add_project_arguments([
+ '-DBMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH'
+ ],
+ language : 'cpp')
+
+ summary({'hostname-patch' :'-DBMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH'
+ },section : 'Enabled Features')
+endif
+
+if( get_option('redfish-allow-deprecated-power-thermal').enabled())
+ add_project_arguments([
+ '-DBMCWEB_ALLOW_DEPRECATED_POWER_THERMAL'
+ ],
+ language : 'cpp')
+
+ summary({'power-thermal' :'-DBMCWEB_ALLOW_DEPRECATED_POWER_THERMAL'
+ },section : 'Enabled Features')
+endif
+
+if( get_option('redfish-new-powersubsystem-thermalsubsystem').enabled())
+ add_project_arguments([
+ '-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM'
+ ],
+ language : 'cpp')
+
+ summary({'new-powersubsystem-thermalsubsystem' :'-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM'
+ },section : 'Enabled Features')
+endif
+
# Set Compiler Security flags
security_flags = [