Skip to content

Commit 9f45f86

Browse files
committed
fix(build): Test apps cannot be built with CMake 3.14
There's an issue with the linker paths to `libNativeScript.a`. Add `NativeScript` target as a target dependency and manually add the path to the library
1 parent 573f420 commit 9f45f86

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎cmake/CreateNativeScriptApp.cmake‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ function(CreateNativeScriptApp _target _main _plist _resources)
1313
)
1414

1515
if(NOT ${BUILD_SHARED_LIBS})
16+
add_dependencies(${_target} NativeScript)
1617
target_link_libraries(${_target}
17-
NativeScript
1818
libicucore.dylib
1919
libz.dylib
2020
libc++.dylib
21+
"-lNativeScript"
22+
"-L${NativeScriptFramework_BINARY_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"
2123
)
2224

2325
if(NOT ${EMBED_STATIC_DEPENDENCIES})

‎src/NativeScript/CMakeLists.txt‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ set(JSFILES
229229
smartStringify.js
230230
)
231231

232-
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/**" "${LIBFFI_INCLUDE_DIR}" "${WEBKIT_INCLUDE_DIRECTORIES}")
232+
include_directories(
233+
"${CMAKE_CURRENT_BINARY_DIR}"
234+
"${CMAKE_CURRENT_SOURCE_DIR}/**"
235+
"${LIBFFI_INCLUDE_DIR}"
236+
"${WEBKIT_INCLUDE_DIRECTORIES}"
237+
)
238+
233239
link_directories("${LIBFFI_LIB_DIR}" ${WEBKIT_LINK_DIRECTORIES})
234240

235241
add_library(NativeScript ${SOURCE_FILES} ${HEADER_FILES} ${JSFILES})

0 commit comments

Comments
 (0)