playing with FFI to golang to make graphql calls...gruesome
This commit is contained in:
+9
-11
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user