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

the compiled framework contains only arm64 #195

Open
xuhaodong1 opened this issue Nov 22, 2023 · 0 comments
Open

the compiled framework contains only arm64 #195

xuhaodong1 opened this issue Nov 22, 2023 · 0 comments

Comments

@xuhaodong1
Copy link

xuhaodong1 commented Nov 22, 2023

hello, I'm new to cmake, I have some problems about this.

I executed the following command

cmake -B build -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OSCOMBINED
cmake --build build --config Release

However, the compiled framework contains only arm64
This is my CMakeList:

CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

PROJECT(lemon_parser)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g")

SET(lemon_parser_sources
    parse.c
    delete.c
    insert.c
    select.c
    update.c
    util.c
    where.c
    tokenize.c
    printf.c
    expr.c
    build.c
    trigger.c
    alter.c
    os_unix.c   
    callback.c
)

SET(HEADER_FILES
include/sqliteInt.h
include/hash.h
include/keywordhash.h
include/os_common.h
include/os.h
include/parse.h
include/sqlite3.h
)


include_directories(${PROJECT_SOURCE_DIR}/include)

set(CMAKE_SYSTEM_NAME iOS)
set(CMAKE_OSX_SYSROOT "iphoneos")
set(CMAKE_OSX_ARCHITECTURES "x86_64" "arm64")
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT "iphoneos")
set(CMAKE_XCODE_ATTRIBUTE_ARCHS "x86_64" "arm64")

ADD_LIBRARY(lemon_parser STATIC ${lemon_parser_sources} ${HEADER_FILES})

set_target_properties(lemon_parser PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER com.shein.lemon_parser
VERSION 1.0.0
SOVERSION 1.0.0
PUBLIC_HEADER "${HEADER_FILES}"
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 12.2
XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
)

This is my execution script:

rm -r build-ios

#!/usr/bin/env bash

mkdir -p build-ios
pushd build-ios
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DENABLE_BITCODE=FALSE
cmake --build . --config Release

Looking forward to your reply, thank you.

@xuhaodong1 xuhaodong1 changed the title why the compiled framework contains only arm64 Nov 23, 2023
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