Add iOS build to CI

This commit is contained in:
Saúl Ibarra Corretgé 2024-04-12 12:24:18 +02:00 committed by GitHub
parent 38fa7d7cf6
commit bb674c0c3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 22 deletions

View file

@ -597,3 +597,15 @@ jobs:
run: | run: |
$ANDROID_HOME/cmake/3.22.1/bin/cmake --build build --target qjs $ANDROID_HOME/cmake/3.22.1/bin/cmake --build build --target qjs
ls -lh build ls -lh build
ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: configure
run: |
cmake -B build -GXcode -DCMAKE_SYSTEM_NAME:STRING=iOS -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED:BOOL=NO -DBUILD_QJS_LIBC=ON
- name: build
run: |
cmake --build build --config Release --target qjs
ls -lh build

View file

@ -27,7 +27,7 @@ macro(xcheck_add_c_compiler_flag FLAG)
endmacro() endmacro()
xcheck_add_c_compiler_flag(-Wall) xcheck_add_c_compiler_flag(-Wall)
if(NOT MSVC) if(NOT MSVC AND NOT IOS)
xcheck_add_c_compiler_flag(-Werror) xcheck_add_c_compiler_flag(-Werror)
xcheck_add_c_compiler_flag(-Wextra) xcheck_add_c_compiler_flag(-Wextra)
endif() endif()
@ -328,6 +328,7 @@ endif()
# Install target # Install target
# #
if(NOT IOS)
file(STRINGS quickjs.h quickjs_h REGEX QJS_VERSION) file(STRINGS quickjs.h quickjs_h REGEX QJS_VERSION)
string(REGEX MATCHALL "([0-9])" QJS_VERSION "${quickjs_h}") string(REGEX MATCHALL "([0-9])" QJS_VERSION "${quickjs_h}")
list(GET QJS_VERSION 0 QJS_VERSION_MAJOR) list(GET QJS_VERSION 0 QJS_VERSION_MAJOR)
@ -349,3 +350,4 @@ install(TARGETS qjs EXPORT qjsConfig
install(EXPORT qjsConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/quickjs) install(EXPORT qjsConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/quickjs)
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(DIRECTORY examples DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(DIRECTORY examples DESTINATION ${CMAKE_INSTALL_DOCDIR})
endif()