0

I want to build my haxe project with a clang compiler. I create the following "build.hxml" file:

-lib hxcpp
-cpp-compiler /usr/bin/clang++
-D linux
-D STATICLIBPREFIX=
-D HXCPP_CLANG
-D HAXE_OUTPUT_PART=myproject
-D HXCPP_API_LEVEL=400
-D HX_SMART_STRINGS
-D HXCPP_CPP11
-D HXCPP_GC_BIG_BLOCKS
-D static_link
-D include-prefix=myproject
-cp src

com.myproject.Dummy

When I run this command line:

haxe -cpp cpp/linux/clang/release build.hxml

I get the following error: "unknown option '-cpp-compiler'".

If I remove this switch (-cpp-compiler /usr/bin/clang++) form the hxml file I get: "sh: 1: g++: not found".

Because for some reason haxe try to use g++ compiler with is not installed in my system.

Also, I tried to set switch "-cpp-toolkit clang" which is also unknown option for the haxe.

nen777w
  • 87
  • 1
  • 1
  • 6
  • Where do you get `cpp-compiler` that is never mentioned in the manual? Have you tried to set CXX environment variable? `CXX=clang++ haxe -cpp <...>`. *The `build.xml` file is read after the choice of compiler has been made, so it is generally not suitable for configuring the compiler.* – 273K Mar 29 '23 at 15:36
  • Thank you! It help. I don know why I forget about CXX variable. Regarding the cpp-compiler and cpp-toolkit option :-) I discussed the same question with a ChatGPT and it ensure me that it options were added to haxe, from version 4.1.0 LOL – nen777w Mar 29 '23 at 16:49
  • How to pass extra compiler flags? The documentation says that I should use -D switch, but if u understand correctly it was intended for the pass predefines. I need to set -fbracket-depth=1024 – nen777w Mar 29 '23 at 17:11

0 Answers0