AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   [Q] What is proper way edit clang flags ? (https://forums.alliedmods.net/showthread.php?t=345949)

Bacardi 02-04-2024 05:33

[Q] What is proper way edit clang flags ?
 
I'm very noob on this MM:S plugin compiling.

This far on Linux, I have follow this tutorial Building SourceMod
and I managed build whole SourceMod, using clang.
Spoiler


Next I wanted to try compile metamod source plugin sample
.../alliedmodders/metamod-source/samples/s1_sample_mm/
PHP Code:

.../alliedmodders/metamod-source/samples/s1_sample_mm/buildpython ../configure.py --sdks css
Checking CC compiler 
(vendor test gcc)... ['clang''test.c''-o''test']
found clang version 10.0
Checking CXX compiler 
(vendor test gcc)... ['clang++''test.cpp''-o''testp']
found clang version 10.0

.../alliedmodders/metamod-source/samples/s1_sample_mm/buildambuild 

Build fail to this clang compiler warning
Spoiler


After googling around and make edit in file, I bypassed that problem. Worked
.../alliedmodders/metamod-source/samples/s1_sample_mm/AMBuildScript
Code:

proj_c_flags = [
  '-Wall',
  '-Wno-non-virtual-dtor',
  '-Wno-overloaded-virtual',
  '-Werror',
  '-Wno-implicit-int-float-conversion',
  '-Wno-unused',
]

PHP Code:

.../alliedmodders/metamod-source/samples/s1_sample_mm/buildambuild
Spawned worker 
(pid3542)
[
3542clang++ -Wall -Wno-non-virtual-dtor -Wno-overloaded-virtual -Werror -Wno-implicit-int-float-conversion -Wno-unused -fPIC -fno-exceptions -fno-rtti -msse -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Wno-delete-non-virtual-dtor -Wno-unused-private-field -Wno-deprecated-register -m32 -g3 -Wno-expansion-to-defined -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -DGNUC -DPOSIX -DLINUX -D_LINUX -DSE_EPISODEONE=-DSE_ORANGEBOX=-DSE_CSS=-DSE_HL2DM=-DSE_DODS=-DSE_SDK2013=-DSE_TF2=11 -DSE_LEFT4DEAD=12 -DSE_NUCLEARDAWN=13 -DSE_LEFT4DEAD2=15 -DSE_DARKMESSIAH=-DSE_ALIENSWARM=16 -DSE_BLOODYGOODTIME=-DSE_EYE=-DSE_CSGO=21 -DSE_DOTA=22 -DSE_PORTAL2=17 -DSE_BLADE=18 -DSE_INSURGENCY=19 -DSE_DOI=20 -DSE_CONTAGION=14 -DSE_BMS=10 -DSOURCE_ENGINE=-DCOMPILER_GCC -/home/amd/Asiakirjat/alliedmodders/metamod-source/samples/s1_sample_mm -/home/amd/Asiakirjat/alliedmodders/metamod-source/core -/home/amd/Asiakirjat/alliedmodders/metamod-source/core/sourcehook -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public/engine -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public/mathlib -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public/vstdlib -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public/tier0 -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public/tier1 -/home/amd/Asiakirjat/alliedmodders/hl2sdk-css/public/game/server --/home/amd/Asiakirjat/alliedmodders/metamod-source/samples/s1_sample_mm/sample_mm.cpp -o sample_mm.o
[3542clang++ sample_mm.o libvstdlib_srv.so libtier0_srv.so -shared -m32 /home/amd/Asiakirjat/alliedmodders/hl2sdk-css/lib/linux/tier1_i486.-shared -o sample_mm2.css.so
Build succeeded




Question is, Is this proper way to remove/add clang flags or is there another/easier way sampling flags ?


*edit
I see, there have made workaround in sourcemod build
https://github.com/alliedmodders/sou...b1ce7011aa8b64
PHP Code:

   # Work around SDK warnings.
    
if cxx.version >= 'clang-10.0':
        
cxx.cflags += [
            
'-Wno-implicit-int-float-conversion',
            
'-Wno-tautological-overlap-compare',
        ] 



All times are GMT -4. The time now is 23:57.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.