Skip to content

Commit

Permalink
fix build on darwin arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberhan123 committed Nov 30, 2023
1 parent e2acba2 commit ac8f5dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
uses: Jimver/[email protected]
with:
cuda: '12.2.0'
method: 'local'

- name: Peek cuda-toolkit info
id: peek_cuda_toolkit
Expand Down
17 changes: 11 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
cmake_minimum_required(VERSION 3.12)

if (APPLE)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
endif ()

project("stable-diffusion-build")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -52,4 +57,4 @@ set_target_properties(ggml PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(stable-diffusion PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(${SD_ABI} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(${SD_ABI} PRIVATE STABLE_DIFFUSION_SHARED STABLE_DIFFUSION_BUILD)
target_link_libraries(${SD_ABI} PRIVATE ggml stable-diffusion ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${SD_ABI} PRIVATE stable-diffusion ${CMAKE_THREAD_LIBS_INIT})

0 comments on commit ac8f5dd

Please sign in to comment.