hgneng / ekho

Chinese text-to-speech engine
GNU General Public License v2.0
1.12k stars 263 forks source link

Fix EKHO_DATA_PATH in CXXFLAGS. #53

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello, AM_CXXFLAGS is for targets without their CXXFLAGS defined [1], since libekho_a_CXXFLAGS is defined, we have to add it ourself for -DEKHO_DATA_PATH.

[1] https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

I also update configure.ac to make it passed for me.

Thank you!

hgneng commented 3 years ago

请问有没有办法保留-O0?没有这个参数编译会太慢。

hgneng commented 3 years ago

Is there a way to keep -O0? It would be too slow to compile without this option.

ghost commented 3 years ago

Hello, You can add -O0 to AM_CXXFLAGS, or add it when invoke make as make CXXFLAGS=-O0.

Note that the linked document said:

you should never redefine a user variable such as CPPFLAGS in Makefile.am

That's because CXXFLAGS is after AM_CXXFLAGS, user can choose override some AM_CXXFLAGS with CXXFLAGS (user may prefer -O3 over -O0 for possible compiler optimizations.)

Hope this helps, thank you!