Merge pull request #2060 from heinrich5991/pr_mac_ci

Add Travis CI for macOS builds
This commit is contained in:
oy 2019-03-11 17:50:45 +01:00 committed by GitHub
commit bde59d73de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 18 deletions

18
.travis.yml Normal file
View file

@ -0,0 +1,18 @@
os: osx
script:
- brew install sdl2
- mkdir build; cd build
- cmake -Werror=dev -DDOWNLOAD_GTEST=ON ..
- make everything
- make run_tests
- make package_default
- cd ..
- mkdir build_debug; cd build_debug
- cmake -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON ..
- make run_tests
- cd ..
- build/teeworlds_srv shutdown
env:
global:
- CFLAGS="-Wdeclaration-after-statement -Werror"
- CXXFLAGS="-Werror"

View file

@ -51,8 +51,8 @@ struct CVoice
int m_X, m_Y;
};
static CSample m_aSamples[NUM_SAMPLES] = {0};
static CVoice m_aVoices[NUM_VOICES] = {0};
static CSample m_aSamples[NUM_SAMPLES] = {{0}};
static CVoice m_aVoices[NUM_VOICES] = {{0}};
static CChannel m_aChannels[NUM_CHANNELS];
static LOCK m_SoundLock = 0;

View file

@ -32,9 +32,9 @@ CMenus::CColumn CMenus::ms_aBrowserCols[] = { // Localize("Server"); Localize("
{COL_BROWSER_PING, IServerBrowser::SORT_PING, "Ping", 1, 40.0f, 0, {0}, {0}, CUI::ALIGN_CENTER},
};
CServerFilterInfo CMenus::CBrowserFilter::ms_FilterStandard = {IServerBrowser::FILTER_COMPAT_VERSION|IServerBrowser::FILTER_PURE|IServerBrowser::FILTER_PURE_MAP, 999, -1, 0, {0}, 0};
CServerFilterInfo CMenus::CBrowserFilter::ms_FilterFavorites = {IServerBrowser::FILTER_COMPAT_VERSION|IServerBrowser::FILTER_FAVORITE, 999, -1, 0, {0}, 0};
CServerFilterInfo CMenus::CBrowserFilter::ms_FilterAll = {IServerBrowser::FILTER_COMPAT_VERSION, 999, -1, 0, {0}, 0};
CServerFilterInfo CMenus::CBrowserFilter::ms_FilterStandard = {IServerBrowser::FILTER_COMPAT_VERSION|IServerBrowser::FILTER_PURE|IServerBrowser::FILTER_PURE_MAP, 999, -1, 0, {{0}}, {0}};
CServerFilterInfo CMenus::CBrowserFilter::ms_FilterFavorites = {IServerBrowser::FILTER_COMPAT_VERSION|IServerBrowser::FILTER_FAVORITE, 999, -1, 0, {{0}}, {0}};
CServerFilterInfo CMenus::CBrowserFilter::ms_FilterAll = {IServerBrowser::FILTER_COMPAT_VERSION, 999, -1, 0, {{0}}, {0}};
// filters

View file

@ -53,7 +53,7 @@ void CMenus::RenderGame(CUIRect MainView)
return;
char aBuf[128];
CSwitchTeamInfo Info = { 0 };
CSwitchTeamInfo Info = {{0}};
GetSwitchTeamInfo(&Info);
CUIRect Button, ButtonRow, Label;

View file

@ -5,11 +5,11 @@
NSTask *task;
NSFileHandle *file;
}
- (void)listenTo: (NSTask*)t;
- (void)listenTo: (NSTask *)t;
@end
@implementation ServerView
- (void)listenTo: (NSTask*)t;
- (void)listenTo: (NSTask *)t
{
NSPipe *pipe;
task = t;
@ -49,24 +49,20 @@ void runServer()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSApp = [NSApplication sharedApplication];
NSBundle* mainBundle = [NSBundle mainBundle];
NSBundle *mainBundle = [NSBundle mainBundle];
NSTask *task;
task = [[NSTask alloc] init];
[task setCurrentDirectoryPath: [mainBundle resourcePath]];
// get a server config
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
NSOpenPanel *openDlg = [NSOpenPanel openPanel];
[openDlg setCanChooseFiles:YES];
if([openDlg runModalForDirectory:nil file:nil] != NSOKButton)
if([openDlg runModal] != NSOKButton)
return;
NSArray* filenames = [openDlg filenames];
if([filenames count] != 1)
return;
NSString* filename = [filenames objectAtIndex: 0];
NSArray* arguments = [NSArray arrayWithObjects: @"-f", filename, nil];
NSString *filename = [[openDlg URL] path];
NSArray *arguments = [NSArray arrayWithObjects: @"-f", filename, nil];
// run server
NSWindow *window;
@ -104,7 +100,7 @@ void runServer()
[pool release];
}
int main (int argc, char **argv)
int main(int argc, char **argv)
{
runServer();