Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev' into feature/#135/save-compiler-env
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-dubreuil committed Apr 12, 2021
2 parents 28fe396 + beaa74a commit e5c3223
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions conf/script/src/build_system/cmd/setup/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3

import build_system.cmd.setup.cli
import build_system.cmd.setup.cli.impl
import utils.cli.main


def main():
build_system.cmd.setup.cli.setup()
build_system.cmd.setup.cli.impl.setup()


utils.cli.main.wrap_main(main)
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from utils.more_typing import PathLike


def colorize_header_laber(header: str) -> str:
def colorize_header_label(header: str) -> str:
return colorama.Fore.LIGHTCYAN_EX + header + colorama.Style.RESET_ALL


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def print_symlink_to_compiler_export_shell_env_script(target: build_system.build_target.build_target.BuildTarget) -> None:
from build_system.cmd.setup.cli_color import colorize_label, colorize_path
from build_system.cmd.setup.cli.colorize import colorize_label, colorize_path

label: Final[str] = colorize_label(label='Symlink to compiler export shell env vars script') + ': '

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def print_meson_main_file(meson_main_file: Path) -> None:
from build_system.cmd.setup.cli_color import colorize_label, colorize_path
from build_system.cmd.setup.cli.colorize import colorize_label, colorize_path

meson_cmd_label: Final[str] = colorize_label(label=f'{BUILD_SYSTEM_NAME.capitalize()} main file') + ': '

Expand All @@ -16,7 +16,7 @@ def print_meson_main_file(meson_main_file: Path) -> None:


def print_meson_cmd(meson_cli_args: list[str]) -> None:
from build_system.cmd.setup.cli_color import colorize_label, colorize_path
from build_system.cmd.setup.cli.colorize import colorize_label, colorize_path

meson_cmd_label: Final[str] = colorize_label(label=f'{BUILD_SYSTEM_NAME.capitalize()} cmd') + ': '

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def print_target_info(compiler_instance: build_system.compiler.installed_instance.CompilerInstance,
target: build_system.build_target.build_target.BuildTarget,
compiler_env_manager: contextlib.AbstractContextManager) -> None:
from build_system.cmd.setup.cli_color import colorize_label, colorize_path, colorize_header_laber
from build_system.cmd.setup.cli.colorize import colorize_label, colorize_path, colorize_header_label

def print_indented_label_and_info(pre_label_indent: str = str(),
post_label_indent: str = str(),
Expand Down Expand Up @@ -102,7 +102,7 @@ def print_post_header_labels_and_info(pre_label_indent: str = str(),
white_space: Final[str] = ' '

header_label = r'Target'
header_colorized_label = colorize_header_laber(header=header_label)
header_colorized_label = colorize_header_label(header=header_label)
post_header_indent = white_space * 6
header_total_indent = (white_space * len(header_label)) + post_header_indent

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from build_system.cmd.setup.find_meson_machine_file import find_build_type_machine_file, find_compiler_machine_file, find_native_machine_files_dir, find_sanitizer_machine_file


def generate_meson_machine_files_cli_args(compiler_instance: build_system.compiler.installed_instance.CompilerInstance,
build_target: build_system.build_target.build_target.BuildTarget) -> list[str]:
def generate_meson_machine_files_args(compiler_instance: build_system.compiler.installed_instance.CompilerInstance,
build_target: build_system.build_target.build_target.BuildTarget) -> list[str]:
import build_system.cmd.hierarchy.find_conf_dir

meson_machine_files_dir = build_system.cmd.hierarchy.find_conf_dir.find_meson_machine_files_dir()
Expand All @@ -18,10 +18,10 @@ def generate_meson_machine_files_cli_args(compiler_instance: build_system.compil
meson_machine_files_dir=meson_machine_files_dir,
native_machine_files_dir=native_machine_files_dir)

machine_files_cli_args: list[str] = _machine_files_to_cli_args(machine_files=machine_files)
_insert_setup_cli_arg_native_file(machine_files_cli_args=machine_files_cli_args)
machine_files_args: list[str] = _machine_files_to_args(machine_files=machine_files)
_insert_setup_arg_native_file(machine_files_args=machine_files_args)

return machine_files_cli_args
return machine_files_args


def _assemble_machine_files(compiler_instance: build_system.compiler.installed_instance.CompilerInstance,
Expand All @@ -36,13 +36,13 @@ def _assemble_machine_files(compiler_instance: build_system.compiler.installed_i
meson_machine_files_dir / r'post-global.ini']


def _machine_files_to_cli_args(machine_files: list[Path]) -> list[str]:
def _machine_files_to_args(machine_files: list[Path]) -> list[str]:
return [str(machine_file) for machine_file in machine_files]


def _insert_setup_cli_arg_native_file(machine_files_cli_args: list[str]) -> None:
setup_cli_arg_native_file: Final[str] = r'--native-file'
def _insert_setup_arg_native_file(machine_files_args: list[str]) -> None:
setup_arg_native_file: Final[str] = r'--native-file'
step: Final[int] = 2

for i in range(0, len(machine_files_cli_args) * step, step):
machine_files_cli_args.insert(i, setup_cli_arg_native_file)
for i in range(0, len(machine_files_args) * step, step):
machine_files_args.insert(i, setup_arg_native_file)
8 changes: 4 additions & 4 deletions conf/script/src/build_system/cmd/setup/meson_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import utils.cmd_integrity
import utils.error.cls_def
from build_system.cmd.hierarchy.consts import BUILD_SYSTEM_NAME
from build_system.cmd.setup.cli_print_meson_cmd import print_meson_cmd, print_meson_main_file
from build_system.cmd.setup.cli_print_target_info import print_target_info
from build_system.cmd.setup.meson_machine_file_cli_args import generate_meson_machine_files_cli_args
from build_system.cmd.setup.cli.meson import print_meson_cmd, print_meson_main_file
from build_system.cmd.setup.cli.target_info import print_target_info
from build_system.cmd.setup.meson_machine_file_args import generate_meson_machine_files_args


def setup_target(root_dir: Path,
Expand Down Expand Up @@ -51,7 +51,7 @@ def _generate_meson_setup_cli_args(root_dir: Path,
meson_cli_args: list[str] = [cli_arg_setup_cmd,
setup_cli_fatal_warnings,
setup_cli_arg_build_type,
*(generate_meson_machine_files_cli_args(compiler_instance=compiler_instance, build_target=build_target)),
*(generate_meson_machine_files_args(compiler_instance=compiler_instance, build_target=build_target)),
setup_cli_arg_build_dir,
setup_cli_arg_source_dir]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_symlinks_to_compilers_export_shell_env_script(targets: list[build_sys

def _create_symlinks_to_compilers_export_shell_env__script(target: build_system.build_target.build_target.BuildTarget,
cli_mode: bool):
from build_system.cmd.setup.cli_print_symlink_to_compiler_export_shell_env import print_symlink_to_compiler_export_shell_env_script
from build_system.cmd.setup.cli.compiler_shell_env import print_symlink_to_compiler_export_shell_env_script

export_shell_env_script: Path = target.compiler_instance.get_export_shell_env_script()

Expand Down

0 comments on commit e5c3223

Please sign in to comment.