-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_plugin.py
executable file
·55 lines (48 loc) · 1.53 KB
/
build_plugin.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import platform
_platform = platform.platform().lower()
_cmake_gen = ""
is_linux = False
is_windows = False
if _platform.startswith("linux"):
_platform = "linux"
is_linux = True
elif _platform.startswith("windows"):
_platform = "windows"
_cmake_gen = " -G \"Visual Studio 17 2022\" -A x64"
is_windows = True
else:
sys.exit("Unknown platform")
build_commands = [
{
"name": "cmake configure release",
"command": "cmake -H. -Bjunk/release_" + _platform + " " + _cmake_gen + " -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX=../bin",
},
{
"name": "cmake build release",
"command": 'cmake --build junk/release_' + _platform + ' --parallel 8 --config Release',
},
{
"name": "cmake configure debug",
"command": "cmake -H. -Bjunk/debug_" + _platform + " " + _cmake_gen + " -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX=../bin",
},
{
"name": "cmake build debug",
"command": "cmake --build junk/debug_" + _platform + " --parallel 8 --config RelWithDebInfo",
},
]
os.chdir("source/plugins/Sea5kg/Python3Scripting")
for _cmd in build_commands:
print("Starting... " + _cmd["name"])
ret = os.system(_cmd["command"])
if ret != 0:
print("Failed... " + _cmd["name"])
sys.exit(-1)
print("Done. " + _cmd["name"] + "\n\n-----\n\n")