Link release and debug builds separately

This commit is contained in:
Miguel M 2023-05-03 15:54:06 +01:00
parent ed739fed17
commit 12d2324731
1 changed files with 7 additions and 6 deletions

13
make.py
View File

@ -18,9 +18,9 @@ COMPILE_FLAGS = [
"-fopenmp",
]
LINK_FLAGS = []
OBJ_DIR = "obj"
OBJ_DIR = os.path.join("obj", "release" if ("RELEASE" in os.environ) else "debug")
SRC_DIR = "src"
EXE_NAME = "main.exe"
EXE_NAME = "main." + ("release" if ("RELEASE" in os.environ) else "debug") + ".exe"
ROOT = os.path.dirname(os.path.realpath(__file__))
@ -28,10 +28,11 @@ if "RELEASE" in os.environ:
COMPILE_FLAGS[COMPILE_FLAGS.index("-O0")] = "-O2"
COMPILE_FLAGS[COMPILE_FLAGS.index("-g3")] = "-g"
COMPILE_FLAGS.append("-DRELEASE")
COMPILE_FLAGS.append('-g')
COMPILE_FLAGS.append("-g")
LINK_FLAGS.append("-DRELEASE")
else:
COMPILE_FLAGS.append('-fsanitize=address,undefined')
LINK_FLAGS.append('-fsanitize=address,undefined')
COMPILE_FLAGS.append("-fsanitize=address,undefined")
LINK_FLAGS.append("-fsanitize=address,undefined")
def as_object(source_path):
@ -100,7 +101,7 @@ def run():
with open(os.path.join(ROOT, "data/2222_inq.txt"), "r") as input:
exe = os.path.join(ROOT, EXE_NAME)
sp.run(
[exe, '2', '2', '2', '2'],
[exe, "2", "2", "2", "2"],
stdin=input,
)