From 77d1cbf3325f9ad9599bb242b83304518434324e Mon Sep 17 00:00:00 2001 From: Rickard Date: Sun, 16 Apr 2023 13:39:34 +0200 Subject: [PATCH] Fixed windows build --- .github/workflows/python-package.yml | 3 +++ CMakeLists.txt | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5493fd066..d98f545c5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -97,6 +97,9 @@ jobs: cuda: ${{ matrix.cuda_version }} method: 'network' sub-packages: '["nvcc","cudart","nvrtc_dev","cublas_dev","cusparse_dev","visual_studio_integration"]' + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + if: ${{ startsWith(matrix.os, 'windows') }} # Compile C++ code - name: Build C++ shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 562b4687d..500b533d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,10 +82,13 @@ if(ENABLE_CUDA) target_link_libraries(bitsandbytes CUDA::cudart CUDA::cublas CUDA::cublasLt CUDA::cusparse) endif() +set_target_properties(bitsandbytes PROPERTIES OUTPUT_NAME "bitsandbytes_${LIBSUFFIX}") # Set the output name of the CUDA library if(MSVC) -set_target_properties(bitsandbytes PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ./bitsandbytes) -set_target_properties(bitsandbytes PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG ./bitsandbytes) +set_target_properties(bitsandbytes PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE bitsandbytes) +set_target_properties(bitsandbytes PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG bitsandbytes) +set_target_properties(bitsandbytes PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE bitsandbytes) +set_target_properties(bitsandbytes PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG bitsandbytes) endif() -set_target_properties(bitsandbytes PROPERTIES LIBRARY_OUTPUT_DIRECTORY ./bitsandbytes) +set_target_properties(bitsandbytes PROPERTIES LIBRARY_OUTPUT_DIRECTORY bitsandbytes)