This fixes a few subtle problems with passing CFLAGS and CXXFLAGS as
environment variables for configure.
First it will now only add these variables to config.mk when they are
actually set. If they are unset then the default optimizations in the
Makefile are set. This avoids passing more than one conflicting
optimization level to the compiler.
Next all CFLAGS are added to CXXFLAGS to avoid issues with forgetting to
set both CFLAGS and CXXFLAGS. This results in the cxx compiler getting
passed several redundant optimization levels when both the CFLAGS and
CXXFLAGS environment variabls are used. Now these uses of CFLAGS in
Makefile.common are set to DEF_FLAGS. This allows adding $(DEF_FLAGS)
to the CXXFLAGS variable without adding redundant flags from CFLAGS.
v2: Update other build files.
Currently RetroArch will install assets for xmb, materialui and ozone
unconditionally.
This change will now only install assets when RetroArch is compiled
with support for the relevant menu driver. This also exposes assets
from the nuklear and zarch menu drivers which are still disabled by
default.
This uses safer quoting and removes an unneeded use of printf.
Fixes the following shellcheck warning.
In qb/qb.libs.sh line 143:
if [ $3 ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
v2: Remove redundant conditional.
C89 builds are only used for the qb build system currently and these are
already checked in qb/config.params.sh.
Additionally the HAVE_NETWORKING check is handled with qb/config.lib.sh
where HAVE_SSL and HAVE_BUILTINMBEDTLS are disabled if networking is
also disabled. The other build systems should never define HAVE_SSL or
HAVE_BUILTINMBEDTLS without HAVE_NETWORKING. Also there are no other
build systems that rely on Makefile.common using this yet.
This does the following.
1. Fixes checking if the CXX compiler works on platforms other than windows.
2. Turns the error when the CXX compiler is missing or doesn't work into a warning.
3. Adds HAVE_CC and HAVE_CXX.
4. Only adds CC and CXX to config.mk when HAVE_CC or HAVE_CXX are true.
5. Disables Qt companion, Vulkan, CXX_BUILD and NEED_CXX_LINKER if HAVE_CXX is false.
6. Explicitly errors when the CXX compiler is broken or missing and Qt or vulkan support is enabled.
7. No longer explicitly links with the CXX compiler on windows since this should no longer be needed.
This also adds the function `check_enabled` to `qb/qb.lib.sh` which
can be used to dynamically disable any libraries that require C++
support.