playing with FFI to golang to make graphql calls...gruesome

This commit is contained in:
talksik
2025-02-21 22:29:50 -08:00
parent 712b5d7916
commit 7fcc9b8177
16 changed files with 1144 additions and 804 deletions
+9 -11
View File
@@ -6,20 +6,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(CURL REQUIRED)
add_subdirectory(external/cppgraphqlgen)
include_directories(${CMAKE_SOURCE_DIR}/src/generated)
# Add the external library directory
include_directories(external)
include_directories(go)
add_executable(flowy_admin src/main.cpp)
target_link_libraries(flowy_admin
graphqlclient
graphqlpeg
graphqlresponse
CURL::libcurl
# Link the Go shared library (using an absolute path)
target_link_libraries(flowy_admin "${CMAKE_SOURCE_DIR}/go/libgraphql.dylib")
# Set the RPATH so the executable knows where to find the shared library at runtime.
# Here we embed the absolute path to the 'go' directory.
set_target_properties(flowy_admin PROPERTIES
BUILD_RPATH "${CMAKE_SOURCE_DIR}/go"
INSTALL_RPATH "${CMAKE_SOURCE_DIR}/go"
)