Skip to content

Commit

Permalink
arch で分岐する
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Nov 16, 2023
1 parent a1b1c17 commit 0ee138d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,7 @@ def install_protoc_gen_jsonif(version, source_dir, install_dir, platform: str):
# なぜか実行属性が消えてるので入れてやる
for file in os.scandir(os.path.join(jsonif_install_dir, 'bin')):
if file.is_file:
os.chmod(file.path, file.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
cmd(['ls', '-lha', os.path.join(jsonif_install_dir, 'bin')])
os.chmod(file.path, file.stat().st_mode | stat.S_IXUSR)


@versioned
Expand Down Expand Up @@ -625,12 +624,19 @@ def main():

args = parser.parse_args()
target_platform = args.target

arch = platform.machine()
if arch in ('AMD64', 'x86_64'):
arch = 'x86_64'
elif arch in ('aarch64', 'arm64'):
arch = 'arm64'

if target_platform in ('ubuntu-20.04_x86_64',):
build_platform = 'ubuntu-20.04_x86_64'
elif target_platform in ('ubuntu-22.04_x86_64',):
build_platform = 'ubuntu-22.04_x86_64'
elif target_platform in ('macos_arm64',):
build_platform = 'macos_arm64'
build_platform = f'macos_{arch}'

logging.info(f'Build platform: {build_platform}')
logging.info(f'Target platform: {target_platform}')
Expand Down

0 comments on commit 0ee138d

Please sign in to comment.