Skip to content

Linux + iPhone Continuity / iMessage / SMS

rename

Zack Bartelccdc54ba2c9a
diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt
index 6f08fbd..88fd98e 100644
--- a/src/cli/CMakeLists.txt
+++ b/src/cli/CMakeLists.txt
@@ -1,8 +1,11 @@
-add_executable(tether
+add_executable(tether_cli
main.cpp
)
-target_link_libraries(tether PRIVATE tether_core)
+target_link_libraries(tether_cli PRIVATE tether)
# Output into root build dir instead of nested build/src/cli
-set_target_properties(tether PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
+set_target_properties(tether_cli PROPERTIES
+ OUTPUT_NAME tether
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+)
diff --git a/src/cli/main.cpp b/src/cli/main.cpp
index 2123889..883d3b1 100644
--- a/src/cli/main.cpp
+++ b/src/cli/main.cpp
@@ -237,7 +237,11 @@ int main(int argc, char* argv[]) {
j["command"] = "clipboard_set";
j["content"] = arg_val;
std::string payload = j.dump() + "\n";
- send_and_wait(payload);
+ std::string s_resp = send_and_wait(payload);
+ if (s_resp.find("unauthorized") != std::string::npos) {
+ std::cerr << "Unauthorized. Device not paired.\n";
+ return 1;
+ }
} else if (action == "file") {
if (arg_val.empty() || !std::filesystem::exists(arg_val)) {
std::cerr << "Invalid or missing file path: " << arg_val << "\n";
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index e6492d6..eee5fa0 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_library(tether_core STATIC
+add_library(tether STATIC
src/core.cpp
src/event_loop.cpp
src/net.cpp
@@ -11,11 +11,11 @@ add_library(tether_core STATIC
src/wayland_protocols/wlr-data-control-unstable-v1.cpp
)
-target_include_directories(tether_core PUBLIC
+target_include_directories(tether PUBLIC
include
)
-target_link_libraries(tether_core PUBLIC
+target_link_libraries(tether PUBLIC
nlohmann_json::nlohmann_json
PkgConfig::WAYLAND
OpenSSL::SSL
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 73b804b..cd5f2e0 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -2,7 +2,7 @@ add_executable(tetherd
main.cpp
)
-target_link_libraries(tetherd PRIVATE tether_core)
+target_link_libraries(tetherd PRIVATE tether)
# Output into root build dir instead of nested build/src/daemon
set_target_properties(tetherd PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
diff --git a/src/gtk/CMakeLists.txt b/src/gtk/CMakeLists.txt
index 437f2b2..7fd4a3a 100644
--- a/src/gtk/CMakeLists.txt
+++ b/src/gtk/CMakeLists.txt
@@ -2,7 +2,7 @@ add_executable(tether-gtk
main.cpp
)
-target_link_libraries(tether-gtk PRIVATE tether_core)
+target_link_libraries(tether-gtk PRIVATE tether)
# Output into root build dir instead of nested build/src/gtk
set_target_properties(tether-gtk PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4a861f1..5c8843e 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -9,7 +9,7 @@ target_include_directories(tether_test PRIVATE
)
target_link_libraries(tether_test PRIVATE
- tether_core
+ tether
GTest::gtest_main
)