cross-compiling: compilation database use wrong command
I have project with CMake, it can build successfully.
But when I generate compilation database by -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
,
it use wrong command int the file
for example All the source file in contracts use wrong command.
{
"directory": "/root/workspace/eos4/build/contracts/eosio.system",
"command": "/usr/bin/clang++-4.0 -I/root/workspace/eos4/contracts/eosio.system/.. -Wall -Wno-invalid-partial-specialization -O3 -DNDEBUG -std=gnu++14 -o CMakeFiles/eosio.system.tmp.dir/eosio.system.cpp.o -c /root/workspace/eos4/contracts/eosio.system/eosio.system.cpp",
"file": "/root/workspace/eos4/contracts/eosio.system/eosio.system.cpp"
},
the right command should be :
/root/opt/wasm/bin/clang -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -nostdlibinc -fno-threadsafe-statics -fno-rtti -fno-exceptions -c /root/workspace/eos4/contracts/eosio.system/eosio.system.cpp -o eosio.system.cpp.bc -Weverything -Wno-c++98-compat -Wno-old-style-cast -Wno-vla -Wno-vla-extension -Wno-c++98-compat-pedantic -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-packed -Wno-padded -Wno-c99-extensions -Wno-documentation-unknown-command -I /root/workspace/eos4/contracts -I /root/workspace/eos4/externals/magic_get/include -isystem /root/workspace/eos4/contracts/libc++/upstream/include -isystem /root/workspace/eos4/contracts/musl/upstream/include -isystem /root/opt/boost/include -isystem /root/workspace/eos4/contracts/libc++/upstream/include -isystem /root/workspace/eos4/contracts/musl/upstream/include -isystem /root/opt/boost/include
the project https://github.com/EOSIO/eos
Thanks.
Edited by Ben Boeckel