Skip to content

Commit

Permalink
more visual studio support effort.
Browse files Browse the repository at this point in the history
  • Loading branch information
droundy committed Jun 2, 2016
1 parent 8530335 commit 5b35e47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bigbro.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*/

#ifdef _MSC_VER
typedef int pid_t
typedef int pid_t;
#endif

int bigbro(const char *workingdir, pid_t *child_ptr,
Expand Down
13 changes: 11 additions & 2 deletions build/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@

print("This is a test under windows")

if compiler == 'cl':
cflags = []
objout = lambda fname: '-Fo'+fname
exeout = lambda fname: '-Fe'+fname
else:
cflags = ['-std=c99', '-g']
objout = lambda fname: '-o='+fname
exeout = objout

def compile(cfile):
cmd = [cc, '-c', '-std=c99', '-O2', '-g', '-o', cfile[:-2]+'.obj', cfile]
cmd = [cc, '-c', '-O2'] + cflags + [objout(cfile[:-2]+'.obj'), cfile]
print(' '.join(cmd))
return subprocess.call(cmd)

Expand All @@ -35,6 +44,6 @@ def compile(cfile):
for c in cfiles:
assert(not compile(c))

cmd = [linker, '-o', 'bigbro.exe'] + [c[:-1]+'obj' for c in cfiles]
cmd = [linker, exeout('bigbro.exe')] + [c[:-1]+'obj' for c in cfiles]
print(' '.join(cmd))
assert(not subprocess.call(cmd))

0 comments on commit 5b35e47

Please sign in to comment.