Skip to content

Commit d80bac5

Browse files
authored
cmake : set CMAKE_RUNTIME_OUTPUT_DIRECTORY for non standalone build (#1394)
Some backend depends on CMAKE_RUNTIME_OUTPUT_DIRECTORY to create temporary file like metal backened. Missing CMAKE_RUNTIME_OUTPUT_DIRECTORY will cause some cmake error like permission denied (try to copy file to root). This PR wants to setup a default path for CMAKE_RUNTIME_OUTPUT_DIRECTORY when it does not exist.
1 parent 1c0fa1e commit d80bac5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
5454
# TODO
5555
else()
5656
set(GGML_STANDALONE OFF)
57+
58+
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
59+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
60+
endif()
5761
endif()
5862

5963
if (EMSCRIPTEN)

0 commit comments

Comments
 (0)