duckdb/postgres_scanner

CMake Error during compiling

SingleLyra opened this issue · 1 comments

Hi, I'm trying to compile this project on Ubuntu 18.04.
I use CLion IDE and build a "cmake-build-debug" directory at the root page.
Then I run cmake .. and it shows the error "CMake Error at CMakeLists.txt:117 (build_loadable_extension): Unknown CMake command "build_loadable_extension"."
So I add this code add_subdirectory(duckdb) at Line116.
图片
After that, I clean the cmake cache and compile the project again, then I got the error inside the “duckdb” directory:

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
CMake Warning at duckdb/CMakeLists.txt:363 (message):
  Please use a recent compiler for debug builds

You have called ADD_LIBRARY for library loadable_extension_demo_loadable_extension without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Configuring done
CMake Error: CMake can not determine linker language for target: loadable_extension_demo_loadable_extension
CMake Error: Cannot determine link language for target "loadable_extension_demo_loadable_extension".
-- Generating done

I'm wondering what I can do to fix this CMake Error.
Thanks!

This is a bit odd because we use DuckDB's build system to build the extension. Try running git pull, which should check out DuckDB as a submodule. Then, in CLion, load duckdb/CMakeLists.txt and set -DEXTERNAL_EXTENSION_DIRECTORIES=../../postgres_scacnner in your build settings. Works for me (TM)

Screenshot 2022-11-07 at 11 25 24