From e7778b010ef5d4221665cc6ad8955efb1ccf9e21 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 14 Oct 2018 15:59:42 +0200 Subject: Add a C test file to test linking and the lib function Once I got linking working, this confirms that the key simulator function actually works. Beef up the Makefile to enable us to properly link the Objective-C library. --- Makefile | 10 ++++++++++ test.c | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 test.c diff --git a/Makefile b/Makefile index 8847e93..15e7867 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,12 @@ +LIB_DEBUG := ~/Library/Developer/Xcode/DerivedData/dome_key_event_source_simulator-*/Build/Products/Debug/libdome_key_event_source_simulator.a + +.PHONY: build build: xcodebuild -scheme dome_key_event_source_simulator -configuration Debug + +test: test.c $(LIB_DEBUG) + gcc -g -Wall -Wextra -Werror -ObjC \ + -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk \ + -o $@ \ + $< \ + $(LIB_DEBUG) diff --git a/test.c b/test.c new file mode 100644 index 0000000..17e1451 --- /dev/null +++ b/test.c @@ -0,0 +1,7 @@ +#include "dome_key_event_source_simulator/dome_key_event_source_simulator.h" + +int main() { + dkess_press_key(0, 0); + + return 0; +} -- cgit v1.2.3