Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions mars/build_watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,30 @@
BUILD_OUT_PATH = 'cmake_build/watchos'
INSTALL_PATH = os.path.join(BUILD_OUT_PATH, 'watchOS.out')

WATCH_BUILD_SIMULATOR_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=SIMULATOR_WATCHOS -DIOS_DEPLOYMENT_TARGET=2.0 -DARCH="i386" -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DENABLE_VISIBILITY=1 && make -j8 && make install'
WATCH_BUILD_OS_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=WATCHOS -DIOS_DEPLOYMENT_TARGET=2.0 -DARCH="armv7k;arm64_32" -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DENABLE_VISIBILITY=1 && make -j8 && make install'
WATCH_BUILD_SIMULATOR_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=SIMULATOR_WATCHOS -DIOS_DEPLOYMENT_TARGET=2.0 -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1 && make -j8 && make install'
WATCH_BUILD_OS_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=WATCHOS -DIOS_DEPLOYMENT_TARGET=2.0 -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1 && make -j8 && make install'

GEN_WATCH_OS_PROJ = 'cmake ../.. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DIOS_PLATFORM=OS -DIOS_DEPLOYMENT_TARGET=2.0 -DIOS_ARCH="armv7;arm64" -DCMAKE_XCODE_ATTRIBUTE_VALID_ARCHS="armv7k;arm64_32" -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DENABLE_VISIBILITY=1'
GEN_WATCH_OS_PROJ = 'cmake ../.. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS -DIOS_DEPLOYMENT_TARGET=2.0 -DIOS_ARCH="armv7;arm64" -DCMAKE_XCODE_ATTRIBUTE_VALID_ARCHS="armv7k;arm64_32;arm64" -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1'


def build_watch(tag=''):
gen_mars_revision_file('comm', tag)

clean(BUILD_OUT_PATH)
os.chdir(BUILD_OUT_PATH)

ret = os.system(WATCH_BUILD_OS_CMD)
os.chdir(SCRIPT_PATH)
if ret != 0:
print('!!!!!!!!!!!build os fail!!!!!!!!!!!!!!!')
return False

libtool_os_dst_lib = INSTALL_PATH + '/os'
if not libtool_libs(glob.glob(INSTALL_PATH + '/*.a'), libtool_os_dst_lib):
libtool_src_libs = [INSTALL_PATH + '/libcomm.a',
INSTALL_PATH + '/libmars-boost.a',
INSTALL_PATH + '/libxlog.a',
BUILD_OUT_PATH + '/zstd/libzstd.a']
if not libtool_libs(libtool_src_libs, libtool_os_dst_lib):
return False

clean(BUILD_OUT_PATH)
Expand All @@ -40,21 +44,20 @@ def build_watch(tag=''):
if ret != 0:
print('!!!!!!!!!!!build simulator fail!!!!!!!!!!!!!!!')
return False

libtool_simulator_dst_lib = INSTALL_PATH + '/simulator'
if not libtool_libs(glob.glob(INSTALL_PATH + '/*.a'), libtool_simulator_dst_lib):
if not libtool_libs(libtool_src_libs, libtool_simulator_dst_lib):
return False

lipo_src_libs = []
lipo_src_libs.append(libtool_os_dst_lib)
lipo_src_libs.append(libtool_simulator_dst_lib)
lipo_dst_lib = INSTALL_PATH + '/mars'

if not lipo_libs(lipo_src_libs, lipo_dst_lib):
return False
dst_framework_path = INSTALL_PATH + '/device/mars.xcframework'
dst_framework_device_path = INSTALL_PATH + '/device/mars.framework'
make_static_framework(libtool_os_dst_lib, dst_framework_device_path, XLOG_COPY_HEADER_FILES, '../')
os.system('mv ' + dst_framework_device_path + '/os ' + dst_framework_device_path + '/mars')

dst_framework_path = INSTALL_PATH + '/mars.framework'
make_static_framework(lipo_dst_lib, dst_framework_path, COMM_COPY_HEADER_FILES, '../')
dst_framework_simulator_path = INSTALL_PATH + '/simu/mars.framework'
make_static_framework(libtool_simulator_dst_lib, dst_framework_simulator_path, XLOG_COPY_HEADER_FILES, '../')
os.system('mv ' + dst_framework_simulator_path + '/simulator ' + dst_framework_simulator_path + '/mars')
os.system('xcodebuild -create-xcframework -framework "' + dst_framework_device_path + '" -framework "' + dst_framework_simulator_path + '" -output "' + dst_framework_path + '"')

print('==================Output========================')
print(dst_framework_path)
Expand Down
8 changes: 4 additions & 4 deletions mars/comm/verinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#ifndef Mars_verinfo_h
#define Mars_verinfo_h

#define MARS_REVISION "38eea3ee"
#define MARS_PATH "release/2024-t2.1"
#define MARS_REVISION "70dff5c7"
#define MARS_PATH "feature/watchos_xcframework"
#define MARS_URL ""
#define MARS_BUILD_TIME "2024-07-30 17:02:21"
#define MARS_BUILD_TIME "2025-04-24 01:52:39"
#define MARS_TAG ""
#define MARS_BUILD_TIMESTAMP 1722330141
#define MARS_BUILD_TIMESTAMP 1745430759

#endif
2 changes: 2 additions & 0 deletions mars/openssl/include/openssl/opensslconf-apple.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# include <openssl/opensslconf_watchos_arm64_32.h>
#elif TARGET_OS_WATCH && TARGET_OS_SIMULATOR && TARGET_CPU_X86
# include <openssl/opensslconf_watchos_sim_i386.h>
#elif TARGET_OS_WATCH && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64
# include <openssl/opensslconf_watchos_sim_x86_64.h>
#elif TARGET_OS_OSX && TARGET_CPU_X86_64
# include <openssl/opensslconf_macos_x86_64.h>
#elif TARGET_OS_OSX && TARGET_CPU_ARM64
Expand Down