Skip to content

Request: Add Debug build mode #162

Open
@y-vectorfield

Description

@y-vectorfield

Thre are some declarations of build mode in the setup_env.py scritpt.
Hence, I suggest adding the following code in it.

Additional argument

Target:
def parse_args():

parser.add_argument("--build-mode", type=str, choices=["Release", "Debug"], default="Debug", help="Build mode of source")

Compiler extra debug args

COMPILER_EXTRA_DEBUG_ARGS = {
    "arm64": ["-DBITNET_ARM_TL1=ON", "-DCMAKE_BUILD_TYPE=Debug"],
    "x86_64": ["-DBITNET_X86_TL2=ON", "-DCMAKE_BUILD_TYPE=Debug"]
}

Additional build process

Target

def compile():

if args.build-mode == "Release":
    run_command(["cmake", "-B", "build", *COMPILER_EXTRA_ARGS[arch], *OS_EXTRA_ARGS.get(platform.system(), [])], log_step="generate_build_files")
    run_command(["cmake", "--build", "build", "--config", "Release"], log_step="compile")
else:
    run_command(["cmake", "-B", "build", *COMPILER_EXTRA_DEBUG_ARGS[arch], *OS_EXTRA_ARGS.get(platform.system(), [])], log_step="generate_build_files")
    run_command(["cmake", "--build", "build", "--config", "Debug"], log_step="compile")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions