Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake出错Target "iot_hal" of type OBJECT_LIBRARY may not be linked into another target #159

Open
yanggeorge opened this issue Nov 22, 2019 · 0 comments

Comments

@yanggeorge
Copy link

cmake config 出错。

错误出在wrappers下的CMakeFiles.txt中

FILE (GLOB wrappers_SRCS

)

ADD_LIBRARY (iot_hal OBJECT    # <--- 这里有错误
    ${wrappers_SRCS}
    ${EXTRA_C_SOURCES}
)

问题:

➜  build git:(v3.0.1) ✗ cmake ../
-- The C compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
---------------------------------------------------------------------
Project Name              : iotkit-embedded-V3.0.1
Source Dir                : /home/ym/work/iotkit-embedded
Binary Dir                : /home/ym/work/iotkit-embedded/build
System Processor          : x86_64
System Platform           : Linux-5.0.0-23-generic
C Compiler                : /usr/bin/cc
Executable Dir            : /home/ym/work/iotkit-embedded/build/bin
Library Dir               : /home/ym/work/iotkit-embedded/build/lib
SDK Version               : V3.0.1

Building on LINUX ...
---------------------------------------------------------------------
You have called ADD_LIBRARY for library iot_hal without any source files. This typically indicates a problem with your CMakeLists.txt file
CMake Error at CMakeLists.txt:83 (TARGET_LINK_LIBRARIES):
  Target "iot_hal" of type OBJECT_LIBRARY may not be linked into another
  target.  One may link only to STATIC or SHARED libraries, or to executables
  with the ENABLE_EXPORTS property set.

重现步骤:

git clone https://github.com/aliyun/iotkit-embedded.git
cd iotkit-embedded
make config
make cmake 
mkdir build
cd build
cmake ../
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant