【resolve】 How to link static libraries of third parties

LanFly
Posts: 2
Joined: Mon Jul 22, 2019 2:50 pm

【resolve】 How to link static libraries of third parties

Postby LanFly » Mon Jul 22, 2019 3:04 pm

How to link a third party static libraries named libjerry-core.a ?

----------------------------------------------------------------------------------
my project:

Code: Select all

- components:
- main:
- deps:
  - jerryscript:
----------------------------------------------------------------------------------
and main/CMakeLists.txt:

Code: Select all

set(COMPONENT_ADD_INCLUDEDIRS "")
set(COMPONENT_SRCDIRS .)

set(COMPONENT_PRIV_INCLUDEDIRS
    ${JERRYSCRIPT_SOURCE}/jerry-core/include
    ${JERRYSCRIPT_SOURCE}/jerry-ext/include
    ${JERRYSCRIPT_SOURCE}/jerry-port/default/include)

register_component()

externalproject_add(jerryscript_build
  PREFIX ${COMPONENT_DIR}
  SOURCE_DIR ${JERRYSCRIPT_SOURCE}
  BUILD_IN_SOURCE 0
  BINARY_DIR jerryscript
  CMAKE_ARGS
    -DJERRY_GLOBAL_HEAP_SIZE=${JERRY_GLOBAL_HEAP_SIZE}
    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
    -DJERRY_CMDLINE=OFF
    -DENABLE_ALL_IN_ONE=ON
    -DCMAKE_C_COMPILER_WORKS=TRUE
    -DCMAKE_SYSROOT=/Users/lan/Documents/workspace/xtensa-esp32-elf/xtensa-esp32-elf/sysroot
)
add_dependencies(main jerryscript_build)
----------------------------------------------------------------------------------
build dir:

Code: Select all

- main:
  - jerryscript:
    - lib:
      - libjerry-core.a
----------------------------------------------------------------------------------
Error:
undefined reference 'jerry_int'

----------------------------------------------------------------------------------
what should i do ?

Who is online

Users browsing this forum: No registered users and 140 guests