Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ option(BARK_CLBLAST "bark: use CLBlast"
option(BARK_METAL "bark: use Metal" OFF)

option(BARK_BUILD_TESTS "bark: build tests" ${BARK_STANDALONE})
option(BARK_BUILD_EXAMPLES "bark: build examples" ${BARK_STANDALONE})

#
# Build info header
Expand Down Expand Up @@ -520,6 +521,10 @@ install(
# programs, examples and tests
#

if (BARK_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if (BARK_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
include(CTest)
add_subdirectory(tests)
Expand Down
9 changes: 9 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(TARGET main)
add_executable(${TARGET} main.cpp)
install(TARGETS ${TARGET} RUNTIME)
target_link_libraries(${TARGET} PRIVATE bark ${CMAKE_THREAD_LIBS_INIT})
target_compile_features(${TARGET} PRIVATE cxx_std_11)
if(TARGET BUILD_INFO)
add_dependencies(${TARGET} BUILD_INFO)
endif()