build: re-enable -flto for gcc and clang.
This commit is contained in:
parent
a0202efc40
commit
8219843ee1
6 changed files with 39 additions and 14 deletions
|
|
@ -15,11 +15,6 @@
|
||||||
|
|
||||||
#include <math.h>
|
#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
|
CR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
constexpr float kFloatEpsilon = 0.01f;
|
constexpr float kFloatEpsilon = 0.01f;
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,11 @@ CR_NAMESPACE_BEGIN
|
||||||
# pragma GCC diagnostic ignored "-Wignored-attributes"
|
# pragma GCC diagnostic ignored "-Wignored-attributes"
|
||||||
#endif
|
#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
|
CR_NAMESPACE_END
|
||||||
|
|
||||||
#if defined(CR_WINDOWS)
|
#if defined(CR_WINDOWS)
|
||||||
|
|
|
||||||
29
meson.build
29
meson.build
|
|
@ -79,16 +79,31 @@ if isCLang or isGCC or (isIntel and not isWindows)
|
||||||
|
|
||||||
if not isDarwin
|
if not isDarwin
|
||||||
flagsCompiler += [
|
flagsCompiler += [
|
||||||
'-pedantic'
|
'-pedantic',
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if isOptimize
|
if isOptimize
|
||||||
flagsCompiler += '-msse2'
|
flagsCompiler += '-msse3'
|
||||||
|
|
||||||
if isCLang and not isDarwin
|
if isCLang or isGCC and not isDarwin
|
||||||
flagsCompiler += '-flto'
|
flagsCompiler += [
|
||||||
flagsLinker += '-flto'
|
'-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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
@ -129,7 +144,7 @@ if isLinux or isDarwin
|
||||||
else
|
else
|
||||||
flagsCompiler += [
|
flagsCompiler += [
|
||||||
'-mtune=generic',
|
'-mtune=generic',
|
||||||
'-msse2',
|
'-msse3',
|
||||||
'-mfpmath=sse',
|
'-mfpmath=sse',
|
||||||
'-fno-builtin',
|
'-fno-builtin',
|
||||||
'-funroll-loops',
|
'-funroll-loops',
|
||||||
|
|
@ -235,7 +250,7 @@ if isWindows and not isCLang
|
||||||
endif
|
endif
|
||||||
|
|
||||||
shared_library (
|
shared_library (
|
||||||
'yapb',
|
meson.project_name (),
|
||||||
sourceFiles,
|
sourceFiles,
|
||||||
include_directories: includes,
|
include_directories: includes,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ private:
|
||||||
public:
|
public:
|
||||||
// get the bot version string
|
// get the bot version string
|
||||||
virtual const char *getBotVersion () override {
|
virtual const char *getBotVersion () override {
|
||||||
return product.version.chars ();
|
return MODULE_BOT_VERSION "." MODULE_BUILD_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// checks if bots are currently in game
|
// 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 {
|
virtual int getBotGoal (int entity) override {
|
||||||
auto bot = getBot (entity);
|
auto bot = getBot (entity);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ FILETYPE 0x2 {
|
||||||
BLOCK "040904E4" {
|
BLOCK "040904E4" {
|
||||||
VALUE "CompanyName", "YaPB Project" "\0"
|
VALUE "CompanyName", "YaPB Project" "\0"
|
||||||
VALUE "FileDescription", "YaPB v" MODULE_BOT_VERSION "." MODULE_BUILD_COUNT " - The Counter-Strike Bot" "\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 "OriginalFilename", "yapb.dll" "\0"
|
||||||
VALUE "ProductName", "YaPB" "\0"
|
VALUE "ProductName", "YaPB" "\0"
|
||||||
VALUE "InternalName", "YaPB DLL" "\0"
|
VALUE "InternalName", "YaPB DLL" "\0"
|
||||||
|
|
|
||||||
9
version_script.lds
Normal file
9
version_script.lds
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
YAPB_ABI_1.0 {
|
||||||
|
global:
|
||||||
|
Meta_*;
|
||||||
|
GiveFnptrsToDll;
|
||||||
|
GetBotAPI;
|
||||||
|
GetEntityAPI;
|
||||||
|
local:
|
||||||
|
*;
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue