mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
slightly clean up cmake file (+3 squashed commit)
Squashed commit: [e050f83db] Revert "test cu11 build on win2022" This reverts commit 1bf989f2b3789c99aa9883cfe70550de6c26db23. [1bf989f2b] test cu11 build on win2022 [5dc94eae8] updated lite
This commit is contained in:
parent
53f1511396
commit
2fdb0acd59
2 changed files with 15 additions and 60 deletions
|
@ -15,17 +15,10 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
|
||||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release")
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(LLAMA_STANDALONE ON)
|
|
||||||
set(BUILD_SHARED_LIBS_DEFAULT ON)
|
|
||||||
set(LLAMA_STATIC OFF)
|
set(LLAMA_STATIC OFF)
|
||||||
set(LLAMA_NATIVE OFF)
|
set(LLAMA_NATIVE OFF)
|
||||||
set(LLAMA_LTO OFF)
|
set(LLAMA_LTO OFF)
|
||||||
set(LLAMA_ALL_WARNINGS OFF)
|
|
||||||
set(LLAMA_ALL_WARNINGS_3RD_PARTY OFF)
|
|
||||||
set(LLAMA_GPROF OFF)
|
set(LLAMA_GPROF OFF)
|
||||||
set(LLAMA_SANITIZE_THREAD OFF)
|
|
||||||
set(LLAMA_SANITIZE_ADDRESS OFF)
|
|
||||||
set(LLAMA_SANITIZE_UNDEFINED OFF)
|
|
||||||
|
|
||||||
|
|
||||||
# instruction set specific
|
# instruction set specific
|
||||||
|
@ -218,52 +211,9 @@ if (LLAMA_HIPBLAS)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LLAMA_ALL_WARNINGS)
|
|
||||||
if (NOT MSVC)
|
|
||||||
set(warning_flags -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function)
|
|
||||||
set(c_flags -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int
|
|
||||||
-Werror=implicit-function-declaration)
|
|
||||||
set(cxx_flags -Wmissing-declarations -Wmissing-noreturn)
|
|
||||||
|
|
||||||
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
||||||
set(warning_flags ${warning_flags} -Wunreachable-code-break -Wunreachable-code-return)
|
|
||||||
set(cxx_flags ${cxx_flags} -Wmissing-prototypes -Wextra-semi)
|
|
||||||
|
|
||||||
if (
|
|
||||||
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8.0) OR
|
|
||||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.3.0)
|
|
||||||
)
|
|
||||||
set(c_flags ${c_flags} -Wdouble-promotion)
|
|
||||||
endif()
|
|
||||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|
||||||
set(c_flags ${c_flags} -Wdouble-promotion)
|
|
||||||
set(cxx_flags ${cxx_flags} -Wno-array-bounds)
|
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.1.0)
|
|
||||||
set(cxx_flags ${cxx_flags} -Wno-format-truncation)
|
|
||||||
endif()
|
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1.0)
|
|
||||||
set(cxx_flags ${cxx_flags} -Wextra-semi)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
# todo : msvc
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_compile_options(
|
|
||||||
${warning_flags}
|
|
||||||
"$<$<COMPILE_LANGUAGE:C>:${c_flags}>"
|
|
||||||
"$<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>"
|
|
||||||
)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LLAMA_LTO)
|
if (LLAMA_LTO)
|
||||||
|
|
25
klite.embd
25
klite.embd
|
@ -7855,7 +7855,7 @@ Current version indicated by LITEVER below.
|
||||||
return checkresult;
|
return checkresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_agnai_wi(obj,chatopponent,myname)
|
function load_agnai_wi(obj)
|
||||||
{
|
{
|
||||||
console.log("Append Agnai WI");
|
console.log("Append Agnai WI");
|
||||||
let loadedwi = [];
|
let loadedwi = [];
|
||||||
|
@ -7879,7 +7879,7 @@ Current version indicated by LITEVER below.
|
||||||
}
|
}
|
||||||
return loadedwi;
|
return loadedwi;
|
||||||
}
|
}
|
||||||
function load_tavern_wi(obj,chatopponent,myname)
|
function load_tavern_wi(obj)
|
||||||
{
|
{
|
||||||
console.log("Append Tavern WI");
|
console.log("Append Tavern WI");
|
||||||
let loadedwi = [];
|
let loadedwi = [];
|
||||||
|
@ -8076,12 +8076,12 @@ Current version indicated by LITEVER below.
|
||||||
importLorebookAsTextDB(obj); //can't fail since same wi check is done beforehand
|
importLorebookAsTextDB(obj); //can't fail since same wi check is done beforehand
|
||||||
documentdb_data = document.getElementById("documentdb_data").value; //save to db
|
documentdb_data = document.getElementById("documentdb_data").value; //save to db
|
||||||
},()=>{
|
},()=>{
|
||||||
current_wi = load_tavern_wi(obj,chatopponent,myname);
|
current_wi = load_tavern_wi(obj);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(agnaidatafieldsempty.trim()=="" && obj.entries && obj.kind=="memory")
|
else if(agnaidatafieldsempty.trim()=="" && obj.entries && obj.kind=="memory")
|
||||||
{
|
{
|
||||||
current_wi = load_agnai_wi(obj,chatopponent,myname);
|
current_wi = load_agnai_wi(obj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -8109,19 +8109,19 @@ Current version indicated by LITEVER below.
|
||||||
//handle character book
|
//handle character book
|
||||||
if(obj.character_book && obj.character_book.entries && obj.character_book.entries.length>0)
|
if(obj.character_book && obj.character_book.entries && obj.character_book.entries.length>0)
|
||||||
{
|
{
|
||||||
current_wi = load_tavern_wi(obj.character_book,chatopponent,myname);
|
current_wi = load_tavern_wi(obj.character_book);
|
||||||
}
|
}
|
||||||
else if (obj.data && obj.data.character_book && obj.data.character_book.entries && obj.data.character_book.entries.length > 0)
|
else if (obj.data && obj.data.character_book && obj.data.character_book.entries && obj.data.character_book.entries.length > 0)
|
||||||
{
|
{
|
||||||
current_wi = load_tavern_wi(obj.data.character_book, chatopponent, myname);
|
current_wi = load_tavern_wi(obj.data.character_book);
|
||||||
}
|
}
|
||||||
else if(obj.entries && obj.entries.length>0)
|
else if(obj.entries && obj.entries.length>0)
|
||||||
{
|
{
|
||||||
current_wi = load_agnai_wi(obj,chatopponent,myname);
|
current_wi = load_agnai_wi(obj);
|
||||||
}
|
}
|
||||||
else if (has_tav_wi_check)
|
else if (has_tav_wi_check)
|
||||||
{
|
{
|
||||||
current_wi = load_tavern_wi(obj,chatopponent,myname);
|
current_wi = load_tavern_wi(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_for_sidepanel();
|
update_for_sidepanel();
|
||||||
|
@ -8311,11 +8311,11 @@ Current version indicated by LITEVER below.
|
||||||
let myname = ((localsettings.chatname && localsettings.chatname!="")?localsettings.chatname:"User");
|
let myname = ((localsettings.chatname && localsettings.chatname!="")?localsettings.chatname:"User");
|
||||||
if(obj.character_book && obj.character_book.entries && obj.character_book.entries.length>0)
|
if(obj.character_book && obj.character_book.entries && obj.character_book.entries.length>0)
|
||||||
{
|
{
|
||||||
temp_scenario.worldinfo = load_tavern_wi(obj.character_book,chatopponent,myname);
|
temp_scenario.worldinfo = load_tavern_wi(obj.character_book);
|
||||||
}
|
}
|
||||||
else if (obj.data && obj.data.character_book && obj.data.character_book.entries && obj.data.character_book.entries.length > 0)
|
else if (obj.data && obj.data.character_book && obj.data.character_book.entries && obj.data.character_book.entries.length > 0)
|
||||||
{
|
{
|
||||||
temp_scenario.worldinfo = load_tavern_wi(obj.data.character_book, chatopponent, myname);
|
temp_scenario.worldinfo = load_tavern_wi(obj.data.character_book);
|
||||||
}
|
}
|
||||||
preview_temp_scenario();
|
preview_temp_scenario();
|
||||||
}
|
}
|
||||||
|
@ -21218,6 +21218,11 @@ Current version indicated by LITEVER below.
|
||||||
try {
|
try {
|
||||||
let { file, fileName, ext, content, plaintext } = fileDetails;
|
let { file, fileName, ext, content, plaintext } = fileDetails;
|
||||||
let wiToAdd = JSON.parse(plaintext);
|
let wiToAdd = JSON.parse(plaintext);
|
||||||
|
let has_tav_wi_check = has_tavern_wi_check(wiToAdd);
|
||||||
|
if(has_tav_wi_check)
|
||||||
|
{
|
||||||
|
wiToAdd = load_tavern_wi(wiToAdd);
|
||||||
|
}
|
||||||
if (wiToAdd && wiToAdd.length > 0)
|
if (wiToAdd && wiToAdd.length > 0)
|
||||||
{
|
{
|
||||||
for (let i = 0; i < wiToAdd.length; ++i)
|
for (let i = 0; i < wiToAdd.length; ++i)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue