C and Python API + Smarter account-based wait times
This commit is contained in:
1 parent
35c568333d
commit
10badb282c
18 files changed
+2204
-429
No files matched your search
+44
-11
@@ -25,34 +25,67 @@ if(NOT SQLite3_FOUND)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
add_library(sqlite3_local STATIC ${sqlite3_amalgamation_SOURCE_DIR}/sqlite3.c)
|
||||
set_target_properties(sqlite3_local PROPERTIES POSITION_INDEPENDENT_CODE ON C_VISIBILITY_PRESET hidden)
|
||||
target_include_directories(sqlite3_local PUBLIC ${sqlite3_amalgamation_SOURCE_DIR})
|
||||
target_link_libraries(sqlite3_local PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
|
||||
add_library(SQLite::SQLite3 ALIAS sqlite3_local)
|
||||
endif()
|
||||
|
||||
# --- Application -------------------------------------------------------------
|
||||
# --- Warnings ----------------------------------------------------------------
|
||||
function(lls_warnings target)
|
||||
if(MSVC)
|
||||
target_compile_options(${target} PRIVATE /W4)
|
||||
else()
|
||||
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# --- Core: the rules, shared by the prompt and the C API ---------------------
|
||||
add_library(lls_core STATIC
|
||||
src/Database.cpp
|
||||
src/Status.cpp
|
||||
src/StringUtil.cpp
|
||||
src/Tracker.cpp
|
||||
src/Views.cpp
|
||||
)
|
||||
target_include_directories(lls_core PUBLIC include)
|
||||
target_link_libraries(lls_core PUBLIC SQLite::SQLite3)
|
||||
set_target_properties(lls_core PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
VISIBILITY_INLINES_HIDDEN ON)
|
||||
lls_warnings(lls_core)
|
||||
|
||||
# --- C API: liblls_api.so / lls_api.dll (include/lls_api.h) ------------------
|
||||
add_library(lls_api SHARED src/capi.cpp)
|
||||
target_link_libraries(lls_api PRIVATE lls_core)
|
||||
target_compile_definitions(lls_api PRIVATE LLS_BUILDING_API)
|
||||
set_target_properties(lls_api PROPERTIES
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
VISIBILITY_INLINES_HIDDEN ON)
|
||||
lls_warnings(lls_api)
|
||||
|
||||
# --- Application: the interactive prompt -------------------------------------
|
||||
add_executable(lls
|
||||
src/main.cpp
|
||||
src/Completer.cpp
|
||||
src/Config.cpp
|
||||
src/Database.cpp
|
||||
src/Display.cpp
|
||||
src/ExternalEditor.cpp
|
||||
src/LineEditor.cpp
|
||||
src/Repl.cpp
|
||||
src/Status.cpp
|
||||
src/StringUtil.cpp
|
||||
src/Table.cpp
|
||||
src/Terminal.cpp
|
||||
src/Tokenizer.cpp
|
||||
src/HomeDirectory.cpp
|
||||
)
|
||||
target_link_libraries(lls PRIVATE lls_core)
|
||||
lls_warnings(lls)
|
||||
|
||||
target_include_directories(lls PRIVATE include)
|
||||
target_link_libraries(lls PRIVATE SQLite::SQLite3)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(lls PRIVATE /W4)
|
||||
else()
|
||||
target_compile_options(lls PRIVATE -Wall -Wextra -Wpedantic)
|
||||
# --- Example: the C API from C -----------------------------------------------
|
||||
option(LLS_BUILD_EXAMPLES "Build the C API example" ON)
|
||||
if(LLS_BUILD_EXAMPLES)
|
||||
add_executable(lls_example examples/example.c)
|
||||
target_link_libraries(lls_example PRIVATE lls_api)
|
||||
target_include_directories(lls_example PRIVATE include)
|
||||
endif()
|
||||
Reference in new issue
Block a user