-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildTest.py
27 lines (19 loc) · 875 Bytes
/
buildTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import subprocess
bin = "C:\\Qt\\Tools\\mingw730_64\\bin"
def parseFiles(folder):
includeFiles = []
for (root, dirs, files) in os.walk(folder):
for file in files:
includeFiles.append((root + '/' + file).rstrip("\n"))
return includeFiles
includeFiles = parseFiles("include")
srcFiles = parseFiles("source")
buildCmd = " -c -DBUILD_DLL " + " ".join(srcFiles) # + " -I ./include"
environment = os.environ.copy()
environment["PATH"] = bin + ";" + environment["PATH"]
#subprocess.run([compiler, buildCmd])
for file in srcFiles:
subprocess.run(bin + "\\g++.exe " + file + " -c -g -std=c++17 " + " -o buildTest/build/" + os.path.splitext(file)[0] + ".o" + " -I include", env=environment)
objFiles = parseFiles("buildTest/build")
subprocess.run(bin + "\\ar.exe rvs buildTest/libpdcore.a " + " ".join(objFiles), env=environment)