From 9e88a1db6852a5ab4ec65c7c937cc45befe5d49e Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Thu, 30 Nov 2023 14:18:41 -0700 Subject: [PATCH] f --- setup.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 0b5b1b75..ed88c703 100644 --- a/setup.py +++ b/setup.py @@ -52,8 +52,6 @@ def run(self): "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14", "-DCMAKE_OSX_ARCHITECTURES=arm64", ] - if platform.system() == "Windows": - target_cmake_config_args += [f"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE={TARGET_BUILD_DIR}"] subprocess.check_call(["cmake", "-S", ".", "-B", TARGET_BUILD_DIR] + target_cmake_config_args, cwd=ROOT_DIR) subprocess.check_call( ["cmake", "--build", TARGET_BUILD_DIR, "--parallel", "--verbose"] + cmake_build_args, @@ -63,8 +61,6 @@ def run(self): if CROSS_COMPILING: # Also build a host version of sleigh to process .sla files host_cmake_config_args = cmake_config_args[::] - if platform.system() == "Windows": - host_cmake_config_args += [f"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE={HOST_BUILD_DIR}"] subprocess.check_call(["cmake", "-S", ".", "-B", HOST_BUILD_DIR] + host_cmake_config_args, cwd=ROOT_DIR) subprocess.check_call( ["cmake", "--build", HOST_BUILD_DIR, "--parallel", "--verbose", "--target", "sleigh"] @@ -74,13 +70,16 @@ def run(self): bin_ext = ".exe" if platform.system() == "Windows" else "" install_pkg_bin_dir = os.path.join(install_pkg_root, "bin") - os.makedirs(install_pkg_bin_dir, exist_ok=True) + sleigh_filename = "sleigh" + bin_ext # Install extension and sleigh binary - ext_path = glob(TARGET_BUILD_DIR + "/pypcode_native.*")[0] - sleigh_filename = "sleigh" + bin_ext - shutil.copy(os.path.join(TARGET_BUILD_DIR, sleigh_filename), os.path.join(install_pkg_bin_dir, sleigh_filename)) - shutil.copy(ext_path, os.path.join(install_pkg_root, os.path.basename(ext_path))) + if CROSS_COMPILING: + os.makedirs(install_pkg_bin_dir, exist_ok=True) + ext_path = glob(TARGET_BUILD_DIR + "/pypcode_native.*")[0] + shutil.copy(os.path.join(TARGET_BUILD_DIR, sleigh_filename), os.path.join(install_pkg_bin_dir, sleigh_filename)) + shutil.copy(ext_path, os.path.join(install_pkg_root, os.path.basename(ext_path))) + else: + subprocess.check_call(["cmake", "--install", TARGET_BUILD_DIR], cwd=ROOT_DIR) # Build sla files host_bin_root = HOST_BUILD_DIR if CROSS_COMPILING else install_pkg_bin_dir