char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
27e345b57
char/aliceai-t5-moe
1set ( TARGET vendor-hash ) 2 3llama_add_compile_flags () 4 5set ( CMAKE_POSITION_INDEPENDENT_CODE ON ) 6 7set ( VENDOR_SRCS 8xxhash/xxhash.c 9sha1/sha1.c 10sha256/sha256.c 11) 12 13add_library ( $ { TARGET } STATIC 14hash.cpp 15hash.h 16${ VENDOR_SRCS } 17) 18 19add_library ( vendor::hash ALIAS ${ TARGET }) 20 21target_compile_features ( $ { TARGET } PRIVATE cxx_std_17 ) 22 23# disable warnings in 3rd party code, but keep them for hash.cpp 24if ( CMAKE_C_COMPILER_IDSTREQUAL "MSVC" ) 25set ( NO_WARN_FLAG /w ) 26else () 27set ( NO_WARN_FLAG -w ) 28endif () 29set_source_files_properties ( $ { VENDOR_SRCS } PROPERTIES COMPILE_OPTIONS ${ NO_WARN_FLAG }) 30 31# sha1 lives in a namespace to avoid a clash with boringssl, see scripts/sync_vendor.py 32set_source_files_properties ( sha1/sha1.c PROPERTIES LANGUAGE CXX ) 33 34# expose the vendor/ root so consumers can include via "hash/hash.h" 35target_include_directories ( $ { TARGET } PUBLIC .. ) 36 37# internal includes of the vendored sources, e.g. sha256.c -> "rotate-bits/rotate-bits.h" 38target_include_directories ( $ { TARGET } PRIVATE . )