1
1
cmake_minimum_required (VERSION 3.15)
2
2
3
3
# Metadata
4
-
5
4
project (NativeScript CXX OBJCXX)
6
5
7
6
set (NAME NativeScript)
@@ -17,7 +16,6 @@ set(COMMON_FLAGS "-O3 -Wno-shorten-64-to-32")
17
16
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} " )
18
17
19
18
# Arguments
20
-
21
19
set (TARGET_PLATFORM "macos" CACHE STRING "Target platform for the Objective-C bridge" )
22
20
set (TARGET_ENGINE "v8" CACHE STRING "Target JS engine for the NativeScript runtime" )
23
21
set (METADATA_SIZE 0 CACHE STRING "Size of embedded metadata in bytes" )
@@ -97,7 +95,6 @@ message(STATUS "ENABLE_JS_RUNTIME = ${ENABLE_JS_RUNTIME}")
97
95
message (STATUS "GENERIC_NAPI = ${GENERIC_NAPI} " )
98
96
99
97
# Set up sources
100
-
101
98
include_directories (
102
99
./
103
100
../metadata-generator/include
@@ -200,12 +197,14 @@ if(ENABLE_JS_RUNTIME)
200
197
)
201
198
202
199
set (SOURCE_FILES ${SOURCE_FILES}
200
+
203
201
# quickjs
204
202
napi/quickjs/source /cutils.c
205
203
napi/quickjs/source /libregexp.c
206
204
napi/quickjs/source /libbf.c
207
205
napi/quickjs/source /libunicode.c
208
206
napi/quickjs/source /quickjs.c
207
+
209
208
# napi
210
209
napi/quickjs/quickjs-api.c
211
210
napi/quickjs/jsr.cpp
@@ -222,7 +221,6 @@ if(ENABLE_JS_RUNTIME)
222
221
napi/jsc/jsc-api.cpp
223
222
napi/jsc/jsr.cpp
224
223
)
225
-
226
224
endif ()
227
225
else ()
228
226
include_directories (
@@ -238,7 +236,6 @@ if(BUILD_CLI_BINARY)
238
236
endif ()
239
237
240
238
# Find SDK
241
-
242
239
find_program (XCODEBUILD_EXECUTABLE xcodebuild)
243
240
244
241
if (METADATA_SIZE EQUAL 0)
@@ -264,7 +261,6 @@ set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
264
261
message (STATUS "SDK = ${CMAKE_OSX_SYSROOT} " )
265
262
266
263
# Build targets
267
-
268
264
if (BUILD_CLI_BINARY)
269
265
add_executable (${NAME} ${SOURCE_FILES} )
270
266
else ()
@@ -300,7 +296,7 @@ endif()
300
296
301
297
if (TARGET_PLATFORM_MACOS)
302
298
# add_custom_command(TARGET ${NAME} POST_BUILD
303
- # COMMAND /usr/libexec/PlistBuddy -c "Add :LSMinimumSystemVersion string ${CMAKE_OSX_DEPLOYMENT_TARGET}" $<TARGET_FILE_DIR:${NAME}>/Resources/Info.plist
299
+ # COMMAND /usr/libexec/PlistBuddy -c "Add :LSMinimumSystemVersion string ${CMAKE_OSX_DEPLOYMENT_TARGET}" $<TARGET_FILE_DIR:${NAME}>/Resources/Info.plist
304
300
# )
305
301
306
302
# Convert the Info.plist from binary format to XML format.
@@ -372,7 +368,7 @@ if(TARGET_ENGINE_JSC)
372
368
endif ()
373
369
374
370
if (TARGET_ENGINE_V8)
375
- if (TARGET_PLATFORM_MACOS)
371
+ if (TARGET_PLATFORM_MACOS)
376
372
target_link_directories (
377
373
${NAME}
378
374
PRIVATE
0 commit comments