build: re-enable -flto for gcc and clang.

This commit is contained in:
ds 2020-11-06 16:23:11 +03:00
commit 8219843ee1
6 changed files with 39 additions and 14 deletions

View file

@ -15,11 +15,6 @@
#include <math.h>
// avoid linking to GLIBC_2.27
#if defined (CR_LINUX) && !defined (CR_CXX_INTEL)
__asm__ (".symver powf,powf@GLIBC_2.0");
#endif
CR_NAMESPACE_BEGIN
constexpr float kFloatEpsilon = 0.01f;

View file

@ -99,6 +99,11 @@ CR_NAMESPACE_BEGIN
# pragma GCC diagnostic ignored "-Wignored-attributes"
#endif
// avoid linking to GLIBC_2.27
#if defined (CR_LINUX) && !defined (CR_CXX_INTEL)
__asm__ (".symver powf, powf@GLIBC_2.0");
#endif
CR_NAMESPACE_END
#if defined(CR_WINDOWS)

View file

@ -79,16 +79,31 @@ if isCLang or isGCC or (isIntel and not isWindows)
if not isDarwin
flagsCompiler += [
'-pedantic'
'-pedantic',
]
endif
if isOptimize
flagsCompiler += '-msse2'
flagsCompiler += '-msse3'
if isCLang and not isDarwin
flagsCompiler += '-flto'
flagsLinker += '-flto'
if isCLang or isGCC and not isDarwin
flagsCompiler += [
'-flto',
'-fdata-sections',
'-ffunction-sections'
]
if isGCC
flagsCompiler += '-fgraphite-identity'
endif
flagsLinker += [
'-flto',
'-flto-partition=none',
'-s',
'-Wl,--version-script=../version_script.lds',
'-Wl,--gc-sections'
]
endif
endif
@ -129,7 +144,7 @@ if isLinux or isDarwin
else
flagsCompiler += [
'-mtune=generic',
'-msse2',
'-msse3',
'-mfpmath=sse',
'-fno-builtin',
'-funroll-loops',
@ -235,7 +250,7 @@ if isWindows and not isCLang
endif
shared_library (
'yapb',
meson.project_name (),
sourceFiles,
include_directories: includes,

View file

@ -26,7 +26,7 @@ private:
public:
// get the bot version string
virtual const char *getBotVersion () override {
return product.version.chars ();
return MODULE_BOT_VERSION "." MODULE_BUILD_COUNT;
}
// checks if bots are currently in game
@ -82,6 +82,7 @@ public:
}
}
// get's the bot current goal node
virtual int getBotGoal (int entity) override {
auto bot = getBot (entity);

View file

@ -24,7 +24,7 @@ FILETYPE 0x2 {
BLOCK "040904E4" {
VALUE "CompanyName", "YaPB Project" "\0"
VALUE "FileDescription", "YaPB v" MODULE_BOT_VERSION "." MODULE_BUILD_COUNT " - The Counter-Strike Bot" "\0"
VALUE "LegalCopyright", "Copyright \251 2020 Project" "\0"
VALUE "LegalCopyright", "Copyright \251 2020 YaPB Project" "\0"
VALUE "OriginalFilename", "yapb.dll" "\0"
VALUE "ProductName", "YaPB" "\0"
VALUE "InternalName", "YaPB DLL" "\0"

9
version_script.lds Normal file
View file

@ -0,0 +1,9 @@
YAPB_ABI_1.0 {
global:
Meta_*;
GiveFnptrsToDll;
GetBotAPI;
GetEntityAPI;
local:
*;
};