#
# qmake configuration for building with linux-openwrt-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

QMAKE_CFLAGS_OPTIMIZE      =
QMAKE_CFLAGS_OPTIMIZE_FULL =
# for whatever reasons $QMAKE_C*FLAGS_RELEASE has set optimization flags directly, instead of referencing $QMAKE_CFLAGS_OPTIMIZE*, so clearing them explicitly, too
QMAKE_CFLAGS_RELEASE   =
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE

# modifications to gcc-base.conf (included by gcc-base-unix.conf)
QMAKE_CFLAGS           += $$(TARGET_CFLAGS)
QMAKE_CXXFLAGS         += $$(TARGET_CXXFLAGS)
QMAKE_LFLAGS           += $$(TARGET_LDFLAGS)

# modifications to g++.conf
QMAKE_CC                = $$(TARGET_CROSS)gcc
QMAKE_CXX               = $$(TARGET_CROSS)g++

QMAKE_LINK_C            = $$QMAKE_CC
QMAKE_LINK_C_SHLIB      = $$QMAKE_CC
QMAKE_LINK              = $$QMAKE_CXX
QMAKE_LINK_SHLIB        = $$QMAKE_CXX


# modifications to linux.conf
QMAKE_AR                = $$(TARGET_CROSS)ar cqs
QMAKE_RANLIB            = $$(TARGET_CROSS)ranlib # QMAKE_RANLIB is set to NULL in linux.conf. Why? Not needed anymore? Set it anyway, just in case...
QMAKE_OBJCOPY           = $$(TARGET_CROSS)objcopy
QMAKE_NM                = $$(TARGET_CROSS)nm # whole qt5 project doesn't use $QMAKE_NM - wonder why it's defined in linux.conf at all. However better set it to ours than keep it being set to the host's version, just in case...
QMAKE_STRIP             = # not used, since -no-strip is passed. Let's OpenWrt do the stripping


load(qt_config)
