mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00

TC 0.7.0 introduces a new `TaskData` type that maps to Taskwarrior's `Task` type more cleanly. It also introduces the idea of gathering lists of operations and "committing" them to a replica. A consequence of this change is that TaskChampion no longer automatically maintains dependency information, so Taskwarrior must do so, with its `TDB2::dependency_sync` method. This method does a very similar thing to what TaskChampion had been doing, so this is a shift of responsibility but not a major performance difference. Cxx is .. not great. It is missing a lot of useful things that make a general-purpose bridge impractical: - no support for trait objects - no support for `Option<T>` (https://github.com/dtolnay/cxx/issues/87) - no support for `Vec<Box<..>>` As a result, some creativity is required in writing the bridge, for example returning a `Vec<OptionTaskData>` from `all_task_data` to allow individual `TaskData` values to be "taken" from the vector. That said, Cxx is the current state-of-the-art, and does a good job of ensuring memory safety, at the cost of some slightly awkward APIs. Subsequent work can remove the "TDB2" layer and allow commands and other parts of Taskwarrior to interface directly with the `Replica`.
74 lines
3.7 KiB
CMake
74 lines
3.7 KiB
CMake
cmake_minimum_required (VERSION 3.22)
|
|
include_directories (${CMAKE_SOURCE_DIR}
|
|
${CMAKE_SOURCE_DIR}/src
|
|
${CMAKE_SOURCE_DIR}/src/commands
|
|
${CMAKE_SOURCE_DIR}/src/columns
|
|
${CMAKE_SOURCE_DIR}/src/libshared/src
|
|
${TASK_INCLUDE_DIRS})
|
|
|
|
add_library (task STATIC CLI2.cpp CLI2.h
|
|
Context.cpp Context.h
|
|
DOM.cpp DOM.h
|
|
Eval.cpp Eval.h
|
|
Filter.cpp Filter.h
|
|
Hooks.cpp Hooks.h
|
|
Lexer.cpp Lexer.h
|
|
TDB2.cpp TDB2.h
|
|
Task.cpp Task.h
|
|
Variant.cpp Variant.h
|
|
Version.cpp Version.h
|
|
ViewTask.cpp ViewTask.h
|
|
dependency.cpp
|
|
feedback.cpp
|
|
legacy.cpp
|
|
nag.cpp
|
|
recur.cpp
|
|
rules.cpp
|
|
sort.cpp
|
|
util.cpp util.h)
|
|
target_link_libraries(task taskchampion-cpp)
|
|
|
|
add_library (libshared STATIC libshared/src/Color.cpp libshared/src/Color.h
|
|
libshared/src/Configuration.cpp libshared/src/Configuration.h
|
|
libshared/src/Datetime.cpp libshared/src/Datetime.h
|
|
libshared/src/Duration.cpp libshared/src/Duration.h
|
|
libshared/src/FS.cpp libshared/src/FS.h
|
|
libshared/src/JSON.cpp libshared/src/JSON.h
|
|
libshared/src/Msg.cpp libshared/src/Msg.h
|
|
libshared/src/Pig.cpp libshared/src/Pig.h
|
|
libshared/src/RX.cpp libshared/src/RX.h
|
|
libshared/src/Table.cpp libshared/src/Table.h
|
|
libshared/src/Timer.cpp libshared/src/Timer.h
|
|
libshared/src/format.cpp libshared/src/format.h
|
|
libshared/src/ip.cpp
|
|
libshared/src/shared.cpp libshared/src/shared.h
|
|
libshared/src/unicode.cpp libshared/src/unicode.h
|
|
libshared/src/utf8.cpp libshared/src/utf8.h
|
|
libshared/src/wcwidth.h)
|
|
|
|
add_executable (task_executable main.cpp)
|
|
add_executable (calc_executable calc.cpp)
|
|
add_executable (lex_executable lex.cpp)
|
|
|
|
# Yes, 'task' (and hence libshared) is included twice, otherwise linking fails on assorted OSes.
|
|
target_link_libraries (task_executable task commands columns libshared task libshared ${TASK_LIBRARIES})
|
|
target_link_libraries (calc_executable task commands columns libshared task libshared ${TASK_LIBRARIES})
|
|
target_link_libraries (lex_executable task commands columns libshared task libshared ${TASK_LIBRARIES})
|
|
if (DARWIN)
|
|
# SystemConfiguration is required by Rust libraries like reqwest, to get proxy configuration.
|
|
target_link_libraries (task_executable "-framework CoreFoundation -framework Security -framework SystemConfiguration")
|
|
target_link_libraries (calc_executable "-framework CoreFoundation -framework Security -framework SystemConfiguration")
|
|
target_link_libraries (lex_executable "-framework CoreFoundation -framework Security -framework SystemConfiguration")
|
|
endif (DARWIN)
|
|
|
|
set_property (TARGET task_executable PROPERTY OUTPUT_NAME "task")
|
|
|
|
install (TARGETS task_executable DESTINATION ${TASK_BINDIR})
|
|
|
|
set_property (TARGET calc_executable PROPERTY OUTPUT_NAME "calc")
|
|
set_property (TARGET lex_executable PROPERTY OUTPUT_NAME "lex")
|
|
|
|
#SET(CMAKE_BUILD_TYPE gcov)
|
|
#SET(CMAKE_CXX_FLAGS_GCOV "--coverage")
|
|
#SET(CMAKE_C_FLAGS_GCOV "--coverage")
|
|
#SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage")
|