From c4ef0e90a4e83de5fc7a74eca635e14c6c5cf130 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Mon, 1 Aug 2022 00:38:10 +0300 Subject: [PATCH] fix dedicated build --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ datacache/datacache.h | 5 ++--- game/shared/collisionproperty.cpp | 2 +- public/engine/thinktracecounter.h | 2 +- public/tier0/threadtools.h | 17 +---------------- scripts/build-ubuntu-amd64.sh | 2 +- scripts/build-ubuntu-i386.sh | 2 +- tier0/threadtools.cpp | 8 ++------ 8 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a9ce5aa..aa6270d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,3 +46,32 @@ jobs: git submodule init && git submodule update ./waf.bat configure -T debug ./waf.bat build + + build-dedicated-windows-i386: + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v2 + - name: Build dedicated windows-i386 + run: | + git submodule init && git submodule update + ./waf.bat configure -T debug -d + ./waf.bat build + + build-dedicated-linux-32: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + - name: Build dedicated linux-i386 + run: | + scripts/build-ubuntu-i386.sh -d + + build-dedicated-linux-64: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + - name: Build dedicated linux-amd64 + run: | + scripts/build-ubuntu-amd64.sh -d diff --git a/datacache/datacache.h b/datacache/datacache.h index 2bbc0e45..afe6cfad 100644 --- a/datacache/datacache.h +++ b/datacache/datacache.h @@ -181,10 +181,9 @@ private: DataCacheItem_t *m_pFirst; int m_iThread; }; - typedef CThreadLocal CThreadFrameLock; CDataCacheLRU & m_LRU; - CThreadFrameLock m_ThreadFrameLock; + CTHREADLOCAL(FrameLock_t*) m_ThreadFrameLock; DataCacheStatus_t m_status; DataCacheLimits_t m_limits; IDataCacheClient * m_pClient; @@ -381,4 +380,4 @@ inline void CDataCacheSection::NoteUnlock( int size ) //----------------------------------------------------------------------------- -#endif // DATACACHE_H \ No newline at end of file +#endif // DATACACHE_H diff --git a/game/shared/collisionproperty.cpp b/game/shared/collisionproperty.cpp index d2f1b6c3..37a42448 100644 --- a/game/shared/collisionproperty.cpp +++ b/game/shared/collisionproperty.cpp @@ -78,7 +78,7 @@ private: CTSListWithFreeList m_DirtyEntities; CThreadSpinRWLock m_partitionMutex; uint32 m_partitionWriteId; - CThreadLocalInt<> m_readLockCount; + CTHREADLOCALINT m_readLockCount; }; diff --git a/public/engine/thinktracecounter.h b/public/engine/thinktracecounter.h index 7aee06b1..e696df92 100644 --- a/public/engine/thinktracecounter.h +++ b/public/engine/thinktracecounter.h @@ -19,7 +19,7 @@ #ifdef THINK_TRACE_COUNTER_COMPILED // create a macro that is true if we are allowed to debug traces during thinks, and compiles out to nothing otherwise. #if defined( _GAMECONSOLE ) || defined( NO_STEAM ) - #define DEBUG_THINK_TRACE_COUNTER_ALLOWED() (!IsCert()) + #define DEBUG_THINK_TRACE_COUNTER_ALLOWED() (false) #else #ifdef THINK_TRACE_COUNTER_COMPILE_FUNCTIONS_ENGINE bool DEBUG_THINK_TRACE_COUNTER_ALLOWED() diff --git a/public/tier0/threadtools.h b/public/tier0/threadtools.h index b99755fa..aefcb1ec 100644 --- a/public/tier0/threadtools.h +++ b/public/tier0/threadtools.h @@ -486,22 +486,7 @@ PLATFORM_INTERFACE void ThreadNotifySyncReleasing(void *p); #ifndef NO_THREAD_LOCAL - -#if ( defined(_LINUX) && defined(DEDICATED) ) && !defined(OSX) -// linux totally supports compiler thread locals, even across dll's. -#define PLAT_COMPILER_SUPPORTED_THREADLOCALS 1 -#define CTHREADLOCALINTEGER( typ ) __thread int -#define CTHREADLOCALINT __thread int -#define CTHREADLOCALPTR( typ ) __thread typ * -#define CTHREADLOCAL( typ ) __thread typ -#define GETLOCAL( x ) ( x ) -#ifndef TIER0_DLL_EXPORT -DLL_IMPORT __thread int g_nThreadID; -#endif -#endif - - -#if defined(WIN32) || defined(OSX) || defined( _PS3 ) || ( defined (_LINUX) && !defined(DEDICATED) ) +#if defined(WIN32) || defined(OSX) || defined( _PS3 ) || ( defined (_LINUX) ) #ifndef __AFXTLS_H__ // not compatible with some Windows headers #if defined(_PS3) diff --git a/scripts/build-ubuntu-amd64.sh b/scripts/build-ubuntu-amd64.sh index 0d4bfa22..9fb9c3d0 100755 --- a/scripts/build-ubuntu-amd64.sh +++ b/scripts/build-ubuntu-amd64.sh @@ -4,5 +4,5 @@ git submodule init && git submodule update sudo apt-get update sudo apt-get install -f -y libopenal-dev g++-multilib gcc-multilib libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev libcurl4-gnutls-dev libsdl2-dev zlib1g-dev libbz2-dev -./waf configure -T debug --64bits --disable-warns && +./waf configure -T debug --64bits --disable-warns $* && ./waf build diff --git a/scripts/build-ubuntu-i386.sh b/scripts/build-ubuntu-i386.sh index 68a1740d..2fbce4f1 100755 --- a/scripts/build-ubuntu-i386.sh +++ b/scripts/build-ubuntu-i386.sh @@ -5,5 +5,5 @@ sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install -f -y libopenal-dev:i386 g++-multilib gcc-multilib libpng-dev:i386 libjpeg-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libcurl4-gnutls-dev:i386 libsdl2-dev:i386 zlib1g-dev:i386 libbz2-dev:i386 -PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T debug --disable-warns && +PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T debug --disable-warns $* && ./waf build diff --git a/tier0/threadtools.cpp b/tier0/threadtools.cpp index ff4ab5a8..46e18298 100644 --- a/tier0/threadtools.cpp +++ b/tier0/threadtools.cpp @@ -94,11 +94,7 @@ const int MAX_THREAD_IDS = 128; static volatile bool s_bThreadIDAllocated[MAX_THREAD_IDS]; -#if defined(_LINUX) && defined(DEDICATED) - -DLL_CLASS_EXPORT __thread int g_nThreadID; - -#elif defined(_PS3) +#if defined(_PS3) #include "tls_ps3.h" #else DLL_CLASS_EXPORT CTHREADLOCALINT g_nThreadID; @@ -1684,7 +1680,7 @@ bool CThreadFullMutex::Release() // //----------------------------------------------------------------------------- -#if defined( WIN32 ) || defined( _PS3 ) || defined( _OSX ) || ( defined (_LINUX) && !defined(DEDICATED) ) +#if defined( WIN32 ) || defined( _PS3 ) || defined( _OSX ) || defined (_LINUX) #if !defined(_PS3) namespace GenericThreadLocals {