View Single Post
Author Message
Sappykun
Member
Join Date: Nov 2019
Old 05-15-2021 , 13:15   How do I tell AMBuild to compile with Clang instead of GCC?
Reply With Quote #1

OS: Ubuntu 18.04
Sourcemod version: 1.10.6502
Metamod version: 1.11.1144
AMBuild version: 2.0

I am trying to build this Late Downloads extension for TF2 and L4D2. While someone has kindly compiled the binaries for me, I would still like to be able to compile it myself so I can edit it later.

When I run configure.py from the latedl/build folder, the script returns this information:

PHP Code:
l4d2@ns531866:~/metamod/latedl/buildpython ../configure.py --hl2sdk-root=/home/l4d2/metamod --mms-path=/home/l4d2/metamod/metamod-source --sm-path=/home/l4d2/metamod/sourcemod --sdks=l4d2,tf2
Checking CC compiler 
(vendor test gcc)... ['cc''test.c''-o''test']
found gcc version 7.5
Checking CXX compiler 
(vendor test gcc)... ['c++''test.cpp''-o''testp']
found gcc version 7.5 
However, when I try to compile the code using ambuild, I get an error. The same error occurs when I use GCC 10.3.

Spoiler


Zynda suggested that Clang would work better for compiling Sourcemod extensions and supports this extension out of the gate.
From what I've been able to gather, if my system has Clang installed (it does, version 6.0.0-1ubuntu2), AMBuild should be trying to use that first. However, I don't see that.

How do I tell AMBuild to compile the extension with Clang? Is there something I need to edit in the build script, or an environment variable I need to change?
Alternatively, what should I try changing in my environment to get GCC to compile the project properly?

Last edited by Sappykun; 11-04-2021 at 12:51.
Sappykun is offline