summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2025-02-04 16:09:59 +0100
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2025-02-04 16:09:59 +0100
commit264de6bdc38a4fd94a39a09c7abbd68b88b880e4 (patch)
tree6505a86a44fd91aec36da92bdfcafc233b705543
parent127c54599c612d7d3d226e4c016d5812e7a0966d (diff)
add support for ios simulator
remoce libmd.tbd dependency
-rwxr-xr-xbuild_single.sh8
-rw-r--r--contrib/depends/Makefile3
-rw-r--r--contrib/depends/hosts/ios.mk1
-rw-r--r--contrib/depends/hosts/iossimulator.mk26
-rw-r--r--contrib/depends/packages/boost.mk5
-rw-r--r--contrib/depends/packages/libiconv.mk1
-rw-r--r--contrib/depends/packages/native_protobuf.mk6
-rw-r--r--contrib/depends/packages/packages.mk1
-rw-r--r--contrib/depends/packages/protobuf.mk6
-rw-r--r--contrib/depends/packages/sodium.mk2
-rw-r--r--contrib/depends/packages/zeromq.mk1
-rw-r--r--monero_libwallet2_api_c/CMakeLists.txt11
12 files changed, 61 insertions, 10 deletions
diff --git a/build_single.sh b/build_single.sh
index 0309a28..c0ace0d 100755
--- a/build_single.sh
+++ b/build_single.sh
@@ -88,23 +88,23 @@ pushd release/$repo
# cp ../../$repo/build/${HOST_ABI}/external/polyseed/libpolyseed.${APPENDIX} ${HOST_ABI}_libpolyseed.${APPENDIX}
# rm ${HOST_ABI}_libpolyseed.${APPENDIX}.xz || true
# xz -e ${HOST_ABI}_libpolyseed.${APPENDIX}
- elif [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "x86_64-host-apple-darwin" || "${HOST_ABI}" == "aarch64-apple-darwin" || "${HOST_ABI}" == "x86_64-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" || "${HOST_ABI}" == "aarch64-apple-ios" ]];
+ elif [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "x86_64-host-apple-darwin" || "${HOST_ABI}" == "aarch64-apple-darwin" || "${HOST_ABI}" == "x86_64-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" || "${HOST_ABI}" == "aarch64-apple-ios" || "${HOST_ABI}" == "aarch64-apple-iossimulator" ]];
then
APPENDIX="${APPENDIX}dylib"
else
APPENDIX="${APPENDIX}so"
fi
- xz -e ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}
+ xz -ek ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}
mv ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz
# Extra libraries
if [[ "$HOST_ABI" == "x86_64-w64-mingw32" || "$HOST_ABI" == "i686-w64-mingw32" ]];
then
cp /usr/${HOST_ABI}/lib/libwinpthread-1.dll ${HOST_ABI}_libwinpthread-1.dll
rm ${HOST_ABI}_libwinpthread-1.dll.xz || true
- xz -e ${HOST_ABI}_libwinpthread-1.dll
+ xz -ek ${HOST_ABI}_libwinpthread-1.dll
####
cp /usr/lib/gcc/${HOST_ABI}/*-posix/libssp-0.dll ${HOST_ABI}_libssp-0.dll
rm ${HOST_ABI}_libssp-0.dll.xz || true
- xz -e ${HOST_ABI}_libssp-0.dll
+ xz -ek ${HOST_ABI}_libssp-0.dll
fi
popd
diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile
index 7474dcf..dd357c8 100644
--- a/contrib/depends/Makefile
+++ b/contrib/depends/Makefile
@@ -91,6 +91,9 @@ endif
ifeq ($(host_os),ios)
host_cmake=iOS
endif
+ifeq ($(host_os),iossimulator)
+host_cmake=iOS
+endif
ifeq ($(host_os),android)
host_cmake=Android
endif
diff --git a/contrib/depends/hosts/ios.mk b/contrib/depends/hosts/ios.mk
index c1a7c33..097fd2d 100644
--- a/contrib/depends/hosts/ios.mk
+++ b/contrib/depends/hosts/ios.mk
@@ -1,6 +1,5 @@
IOS_MIN_VERSION=12.0
IOS_SDK=$(shell xcrun --sdk iphoneos --show-sdk-path)
-IOS_SIMULATOR_SDK=$(shell xcrun --sdk iphonesimulator --show-sdk-path)
ifeq (aarch64, $(host_arch))
CC_target_ios=arm64-apple-ios
diff --git a/contrib/depends/hosts/iossimulator.mk b/contrib/depends/hosts/iossimulator.mk
new file mode 100644
index 0000000..60599db
--- /dev/null
+++ b/contrib/depends/hosts/iossimulator.mk
@@ -0,0 +1,26 @@
+IOS_MIN_VERSION=12.0
+IOS_SDK=$(shell xcrun --sdk iphonesimulator --show-sdk-path)
+
+ifeq (aarch64, $(host_arch))
+CC_target_iossimulator=arm64-apple-ios-simulator
+iossimulator_host=arm64-apple-darwin
+aarch64_iossimulator_host=arm64-apple-darwin
+else
+CC_target_iossimulator=x86_64-apple-ios-simulator
+iossimulator_host=x86_64-apple-darwin
+x86_64_iossimulator_host=x86_64-apple-darwin
+endif
+iossimulator_CC=$(shell xcrun -f clang) -target $(CC_target_iossimulator) -mios-version-min=$(IOS_MIN_VERSION) --sysroot $(IOS_SDK)
+iossimulator_CXX=$(shell xcrun -f clang++) -target $(CC_target_iossimulator) -mios-version-min=$(IOS_MIN_VERSION) --sysroot $(IOS_SDK) -stdlib=libc++ -std=c++14
+iossimulator_AR:=$(shell xcrun -f ar)
+iossimulator_RANLIB:=$(shell xcrun -f ranlib)
+iossimulator_STRIP:=$(shell xcrun -f strip)
+iossimulator_LIBTOOL:=$(shell xcrun -f libtool)
+iossimulator_OTOOL:=$(shell xcrun -f otool)
+iossimulator_NM:=$(shell xcrun -f nm)
+iossimulator_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
+iossimulator_native_toolchain=
+
+
+iossimulator_CFLAGS=-pipe
+iossimulator_CXXFLAGS=$(iossimulator_CFLAGS) \ No newline at end of file
diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk
index efbfdec..0836409 100644
--- a/contrib/depends/packages/boost.mk
+++ b/contrib/depends/packages/boost.mk
@@ -16,6 +16,7 @@ $(package)_config_opts_linux=threadapi=pthread runtime-link=static
$(package)_config_opts_android=threadapi=pthread runtime-link=static target-os=android
$(package)_config_opts_darwin=--toolset=darwin runtime-link=static
$(package)_config_opts_ios=--toolset=darwin-$($(package)_ios_COMPILER_VERSION)~iphone runtime-link=static
+$(package)_config_opts_iossimulator=--toolset=darwin-$($(package)_ios_COMPILER_VERSION)~iphone runtime-link=static
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
$(package)_config_opts_x86_64_mingw32=address-model=64
$(package)_config_opts_i686_mingw32=address-model=32
@@ -24,12 +25,15 @@ $(package)_toolset_$(host_os)=gcc
$(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_archiver_darwin=$($(package)_libtool)
$(package)_archiver_ios=$($(package)_libtool)
+$(package)_archiver_iossimulator=$($(package)_libtool)
$(package)_toolset_darwin=darwin
$(package)_toolset_ios=darwin
+$(package)_toolset_iossimulator=darwin
$(package)_toolset_android=gcc
$(package)_toolset_mingw32=gcc
$(package)_toolset2_$(host_os)=
$(package)_toolset2_ios=$($(package)_ios_COMPILER_VERSION)~iphone
+$(package)_toolset2_iossimulator=$($(package)_ios_COMPILER_VERSION)~iphone
$(package)_config_libraries=system,filesystem,thread,timer,date_time,chrono,regex,serialization,atomic,program_options,locale,log
$(package)_cxxflags_linux=-fPIC
$(package)_cxxflags_freebsd=-fPIC
@@ -37,6 +41,7 @@ $(package)_cxxflags_android=-fPIC
$(package)_cxxflags_darwin=-fPIC -std=c++11
$(package)_ldflags_darwin=-L$(host_prefix)/lib -L$(shell xcrun --sdk macosx --show-sdk-path)/usr/lib
$(package)_ldflags_ios=-L$(host_prefix)/lib -L$(IOS_SDK)/usr/lib
+$(package)_ldflags_iossimulator=-L$(host_prefix)/lib -L$(IOS_SDK)/usr/lib
endef
define $(package)_preprocess_cmds
diff --git a/contrib/depends/packages/libiconv.mk b/contrib/depends/packages/libiconv.mk
index abd1b71..f521cc7 100644
--- a/contrib/depends/packages/libiconv.mk
+++ b/contrib/depends/packages/libiconv.mk
@@ -11,6 +11,7 @@ define $(package)_set_vars
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_freebsd=--with-pic
$(package)_ar_ios=$($(package)_ar)
+ $(package)_ar_iossimulator=$($(package)_ar)
endef
define $(package)_preprocess_cmds
diff --git a/contrib/depends/packages/native_protobuf.mk b/contrib/depends/packages/native_protobuf.mk
index 2ef299c..7bd336b 100644
--- a/contrib/depends/packages/native_protobuf.mk
+++ b/contrib/depends/packages/native_protobuf.mk
@@ -11,6 +11,12 @@ define $(package)_set_vars
endef
define $(package)_config_cmds
+ cp -f $(BASEDIR)/config.guess config.guess &&\
+ cp -f $(BASEDIR)/config.sub config.sub &&\
+ cp -f $(BASEDIR)/config.guess third_party/googletest/googletest/build-aux/config.guess &&\
+ cp -f $(BASEDIR)/config.sub third_party/googletest/googletest/build-aux/config.sub &&\
+ cp -f $(BASEDIR)/config.guess third_party/googletest/googlemock/build-aux/config.guess &&\
+ cp -f $(BASEDIR)/config.sub third_party/googletest/googlemock/build-aux/config.sub &&\
$($(package)_autoconf)
endef
diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk
index 9059d9b..fdeb5f3 100644
--- a/contrib/depends/packages/packages.mk
+++ b/contrib/depends/packages/packages.mk
@@ -14,6 +14,7 @@ android_packages = ncurses readline sodium
darwin_native_packages = $(hardware_native_packages)
darwin_packages = ncurses readline sodium $(hardware_packages)
ios_packages = sodium protobuf native_protobuf
+iossimulator_packages = sodium protobuf native_protobuf
# not really native...
freebsd_native_packages = freebsd_base
diff --git a/contrib/depends/packages/protobuf.mk b/contrib/depends/packages/protobuf.mk
index 5ee93ba..6c2fb0d 100644
--- a/contrib/depends/packages/protobuf.mk
+++ b/contrib/depends/packages/protobuf.mk
@@ -18,6 +18,12 @@ define $(package)_preprocess_cmds
endef
define $(package)_config_cmds
+ cp -f $(BASEDIR)/config.guess config.guess &&\
+ cp -f $(BASEDIR)/config.sub config.sub &&\
+ cp -f $(BASEDIR)/config.guess third_party/googletest/googletest/build-aux/config.guess &&\
+ cp -f $(BASEDIR)/config.sub third_party/googletest/googletest/build-aux/config.sub &&\
+ cp -f $(BASEDIR)/config.guess third_party/googletest/googlemock/build-aux/config.guess &&\
+ cp -f $(BASEDIR)/config.sub third_party/googletest/googlemock/build-aux/config.sub &&\
$($(package)_autoconf)
endef
diff --git a/contrib/depends/packages/sodium.mk b/contrib/depends/packages/sodium.mk
index 0050bd3..53267b2 100644
--- a/contrib/depends/packages/sodium.mk
+++ b/contrib/depends/packages/sodium.mk
@@ -17,6 +17,8 @@ define $(package)_preprocess_cmds
endef
define $(package)_config_cmds
+ cp -f $(BASEDIR)/config.guess build-aux/config.guess &&\
+ cp -f $(BASEDIR)/config.sub build-aux/config.sub &&\
$($(package)_autoconf)
endef
diff --git a/contrib/depends/packages/zeromq.mk b/contrib/depends/packages/zeromq.mk
index 3af263c..0c47a6c 100644
--- a/contrib/depends/packages/zeromq.mk
+++ b/contrib/depends/packages/zeromq.mk
@@ -10,6 +10,7 @@ define $(package)_set_vars
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_freebsd=--with-pic
$(package)_config_opts_ios=--host=$(host_arch)-apple-darwin
+ $(package)_config_opts_iossimulator=--host=$(host_arch)-apple-darwin
$(package)_cxxflags=-std=c++11
$(package)_cxxflags_darwin=-std=c++11
$(package)_cxxflags_ios=-std=c++11
diff --git a/monero_libwallet2_api_c/CMakeLists.txt b/monero_libwallet2_api_c/CMakeLists.txt
index 6790333..e2e7139 100644
--- a/monero_libwallet2_api_c/CMakeLists.txt
+++ b/monero_libwallet2_api_c/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5)
project(wallet2_api_c)
message(STATUS ABI_INFO = ${HOST_ABI})
+set(MD_LIBRARY "")
+
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
@@ -65,7 +67,7 @@ elseif(${HOST_ABI} STREQUAL "host-apple-darwin" OR
${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR
${HOST_ABI} STREQUAL "aarch64-host-apple-darwin")
set(EXTRA_LIBS_APPLE "-framework IOKit" "-framework CoreFoundation" "-framework Cocoa" apple_nghttp2)
-elseif(${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios" OR ${HOST_ABI} STREQUAL "arm64-apple-ios")
+elseif(${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios" OR ${HOST_ABI} STREQUAL "arm64-apple-ios" OR ${HOST_ABI} STREQUAL "arm64-apple-iossimulator" OR ${HOST_ABI} STREQUAL "x86_64-apple-iossimulator")
set(EXTRA_LIBS_APPLE "-framework IOKit" "-framework CoreFoundation" iconv )
endif()
@@ -73,7 +75,7 @@ if(${HOST_ABI} STREQUAL "x86_64-w64-mingw32" OR ${HOST_ABI} STREQUAL "i686-w64-m
target_link_options(wallet2_api_c PRIVATE -static-libgcc -static-libstdc++)
endif()
-if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios")
+if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios" OR ${HOST_ABI} STREQUAL "arm64-apple-iossimulator" OR ${HOST_ABI} STREQUAL "x86_64-apple-iossimulator")
set_target_properties(wallet2_api_c PROPERTIES SUFFIX ".dylib")
set_target_properties(wallet2_api_c PROPERTIES NO_SONAME 1)
@@ -88,7 +90,7 @@ elseif(${MONERO_FLAVOR} STREQUAL "zano")
target_compile_definitions(wallet2_api_c PRIVATE FLAVOR_ZANO)
endif()
-if(NOT ${HOST_ABI} STREQUAL "x86_64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "x86_64-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "host-apple-ios" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-ios")
+if(NOT ${HOST_ABI} STREQUAL "x86_64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "x86_64-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "host-apple-ios" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-ios" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-iossimulator" AND NOT ${HOST_ABI} STREQUAL "x86_64-apple-iossimulator")
set_target_properties(wallet2_api_c PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
endif()
@@ -99,8 +101,7 @@ if (${MONERO_FLAVOR} STREQUAL "zano")
endif()
add_subdirectory("${CMAKE_SOURCE_DIR}/../${MONERO_FLAVOR}" ${CMAKE_BINARY_DIR}/${MONERO_FLAVOR}_build EXCLUDE_FROM_ALL)
-
-if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "x86_64-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios")
+if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "x86_64-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-iossimulator" OR ${HOST_ABI} STREQUAL "x86_64-apple-iossimulator")
if (${MONERO_FLAVOR} STREQUAL "monero")
set(EXPORTED_SYMBOLS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/monero_libwallet2_api_c.exp)
elseif(${MONERO_FLAVOR} STREQUAL "wownero")