Skip to content

Commit 195a674

Browse files
committed
add macos workflow, fix filesystem_async max thread count
1 parent 231c1e1 commit 195a674

File tree

7 files changed

+61
-26
lines changed

7 files changed

+61
-26
lines changed

.github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,21 @@ jobs:
9191
- name: Build dedicated linux-amd64
9292
run: |
9393
scripts/build-ubuntu-amd64.sh -d
94+
95+
build-macos-amd64:
96+
runs-on: macos-latest
97+
98+
steps:
99+
- uses: actions/checkout@v2
100+
- name: Build macos-amd64
101+
run: |
102+
scripts/build-macos-amd64.sh
103+
104+
build-dedicated-macos-amd64:
105+
runs-on: macos-latest
106+
107+
steps:
108+
- uses: actions/checkout@v2
109+
- name: Build dedicated macos-amd64
110+
run: |
111+
scripts/build-macos-amd64.sh -d

.github/workflows/tests.yml

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ jobs:
2121
run: |
2222
scripts/tests-ubuntu-amd64.sh
2323
24+
tests-macos-amd64:
25+
runs-on: macos-latest
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Run tests macos-amd64
30+
run: |
31+
scripts/tests-macos-amd64.sh
32+
2433
tests-windows-i386:
2534
runs-on: windows-2019
2635

appframework/wscript

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ def build(bld):
2424
source += [
2525
'sdlmgr.cpp'
2626
]
27-
28-
if bld.env.DEST_OS == 'darwin':
29-
source += [
30-
'glmrendererinfo_osx.mm'
31-
]
3227

3328
if bld.env.DEST_OS == 'win32':
3429
source += [

filesystem/filesystem_async.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -659,16 +659,16 @@ void CBaseFileSystem::InitAsync()
659659
Msg( "Async I/O disabled from command line\n" );
660660
return;
661661
}
662-
662+
#ifndef UNITTESTS
663663
if ( VCRGetMode() == VCR_Disabled )
664+
#endif
664665
{
665666
// create the i/o thread pool
666667
m_pThreadPool = CreateThreadPool();
667668

668669
ThreadPoolStartParams_t params;
669670
params.iThreadPriority = 0;
670671
params.bIOThreads = true;
671-
params.nThreadsMax = 4; // Limit count of IO threads to a maximum of 4.
672672
if ( IsX360() )
673673
{
674674
// override defaults
@@ -678,11 +678,10 @@ void CBaseFileSystem::InitAsync()
678678
params.bUseAffinityTable = true;
679679
params.iAffinityTable[0] = XBOX_PROCESSOR_3;
680680
}
681-
else if( IsPC() )
681+
else
682682
{
683-
// override defaults
684-
// maximum # of async I/O thread on PC is 2
685-
params.nThreads = 1;
683+
params.nThreadsMax = MIN(params.nThreads, 4); // Limit count of IO threads to a maximum of 4.
684+
params.nStackSize = 256*1024;
686685
}
687686

688687
if ( !m_pThreadPool->Start( params, "IOJob" ) )

scripts/build-macos-amd64.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
git submodule init && git submodule update
4+
5+
brew install sdl2
6+
7+
./waf configure -T debug --64bits --disable-warns $* &&
8+
./waf build

scripts/tests-macos-amd64.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
git submodule init && git submodule update
4+
./waf configure -T release --sanitize=address,undefined --disable-warns --tests -8 --prefix=out/ $* &&
5+
./waf install &&
6+
cd out &&
7+
DYLD_LIBRARY_PATH=bin/ ./unittest || exit 1

wscript

+14-15
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,20 @@ def check_deps(conf):
323323
for i in a:
324324
conf.check_cc(lib = i)
325325

326+
if conf.env.DEST_OS == "darwin":
327+
conf.check(lib='iconv', uselib_store='ICONV')
328+
conf.env.FRAMEWORK_APPKIT = "AppKit"
329+
conf.env.FRAMEWORK_IOKIT = "IOKit"
330+
conf.env.FRAMEWORK_FOUNDATION = "Foundation"
331+
conf.env.FRAMEWORK_COREFOUNDATION = "CoreFoundation"
332+
conf.env.FRAMEWORK_COREGRAPHICS = "CoreGraphics"
333+
conf.env.FRAMEWORK_OPENGL = "OpenGL"
334+
conf.env.FRAMEWORK_CARBON = "Carbon"
335+
conf.env.FRAMEWORK_APPLICATIONSERVICES = "ApplicationServices"
336+
conf.env.FRAMEWORK_CORESERVICES = "CoreServices"
337+
conf.env.FRAMEWORK_COREAUDIO = "CoreAudio"
338+
conf.env.FRAMEWORK_AUDIOTOOLBOX = "AudioToolbox"
339+
conf.env.FRAMEWORK_SYSTEMCONFIGURATION = "SystemConfiguration"
326340

327341
if conf.options.TESTS:
328342
return
@@ -361,21 +375,6 @@ def check_deps(conf):
361375
conf.check(lib='android_support', uselib_store='ANDROID_SUPPORT')
362376
conf.check(lib='opus', uselib_store='OPUS')
363377

364-
if conf.env.DEST_OS == "darwin":
365-
conf.check(lib='iconv', uselib_store='ICONV')
366-
conf.env.FRAMEWORK_APPKIT = "AppKit"
367-
conf.env.FRAMEWORK_IOKIT = "IOKit"
368-
conf.env.FRAMEWORK_FOUNDATION = "Foundation"
369-
conf.env.FRAMEWORK_COREFOUNDATION = "CoreFoundation"
370-
conf.env.FRAMEWORK_COREGRAPHICS = "CoreGraphics"
371-
conf.env.FRAMEWORK_OPENGL = "OpenGL"
372-
conf.env.FRAMEWORK_CARBON = "Carbon"
373-
conf.env.FRAMEWORK_APPLICATIONSERVICES = "ApplicationServices"
374-
conf.env.FRAMEWORK_CORESERVICES = "CoreServices"
375-
conf.env.FRAMEWORK_COREAUDIO = "CoreAudio"
376-
conf.env.FRAMEWORK_AUDIOTOOLBOX = "AudioToolbox"
377-
conf.env.FRAMEWORK_SYSTEMCONFIGURATION = "SystemConfiguration"
378-
379378
if conf.env.DEST_OS == 'win32':
380379
conf.check(lib='libz', uselib_store='ZLIB', define_name='USE_ZLIB')
381380
# conf.check(lib='nvtc', uselib_store='NVTC')

0 commit comments

Comments
 (0)