Skip to content

faust should be able to pass compiler flags supplied by the user #1109

@yurivict

Description

@yurivict

I am getting this failure:

$ faust2jaqt example-freeverb_demo.dsp
In file included from example-freeverb_demo.cpp:5018:
In file included from /usr/local/include/qt6/QtCore/QtGlobal:1:
In file included from /usr/local/include/qt6/QtCore/qglobal.h:26:
In file included from /usr/local/include/qt6/QtCore/qtcoreexports.h:7:
/usr/local/include/qt6/QtCore/qcompilerdetection.h:1260:6: error: "Qt requires a C++17 compiler"
 1260 | #    error "Qt requires a C++17 compiler"
      |      ^

The default compiler isn't C++17 compatible by default. It needs special compiler flags for this.

The faust2jaqt executable should allow to pass compiler flags CXXFLAGS to the compiler.
Alternatively, or additionally, it should use the same compiler and compiler flags that were used during compilation.

Currently it isn't clear how to do that.


After some more analysis, I found that faust2jaqt wrote -std=c++11 into the Makefile:

####### Compiler, tools and options

CC            = clang
CXX           = clang++
DEFINES       = -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS        = -pipe -O2 -w -fPIC -pthread $(DEFINES)
CXXFLAGS      = -std=c++11 -Ofast -march=native -Wno-unused-parameter -O2 -w -fPIC -pthread $(DEFINES)
INCPATH       = -I. -I../../../stage/usr/local/include -I. -I/usr/local/include/qt6 -I/usr/local/include/qt6/QtPrintSupport -I/usr/local/include/qt6/QtWidgets -I/usr/local/include/qt6/QtGui -I/usr/local/include/qt6/QtNetwork -I/usr/local/include/qt6/QtCore -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/lib/qt6/mkspecs/freebsd-clang
QMAKE         = /usr/local/bin/qmake6

This Makefile can't succeed because Qt6 explicitly requires C++17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions