diff --git a/common.gypi b/common.gypi index e56de414838..316046fd67b 100644 --- a/common.gypi +++ b/common.gypi @@ -423,7 +423,7 @@ 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics 'PREBINDING': 'NO', # No -Wl,-prebind - 'IPHONEOS_DEPLOYMENT_TARGET': '11.0', + 'IPHONEOS_DEPLOYMENT_TARGET': '9.0', # -miphoneos-version-min=9.0 'USE_HEADERMAP': 'NO', 'OTHER_CFLAGS': [ '-fno-strict-aliasing', diff --git a/deps/chakrashim/core/CMakeLists.txt b/deps/chakrashim/core/CMakeLists.txt index 8a6d4b428a9..4f1974fc92e 100644 --- a/deps/chakrashim/core/CMakeLists.txt +++ b/deps/chakrashim/core/CMakeLists.txt @@ -250,25 +250,22 @@ elseif(CC_TARGET_OS_OSX OR CC_TARGET_OS_IOS) ) set(IOS_DEPLOYMENT_TARGET "$ENV{IPHONEOS_DEPLOYMENT_TARGET} CC") if (${IOS_DEPLOYMENT_TARGET} STREQUAL " CC") - set(IOS_DEPLOYMENT_TARGET "11.0") + set(IOS_DEPLOYMENT_TARGET "9.0") if(CC_TARGETS_ARM64) #iOS Physical device. - add_compile_options(-miphoneos-version-min=11.0) + add_compile_options(-miphoneos-version-min=9.0) # isysroot is the result from running -> xcodebuild -version -sdk iphoneos Path add_compile_options(-isysroot ${CMAKE_IOS_SDK_ROOT}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \ - -miphoneos-version-min=11.0 -fembed-bitcode -std=gnu99 -isysroot ${CMAKE_IOS_SDK_ROOT}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ - -miphoneos-version-min=11.0 -fembed-bitcode -std=gnu++11 -isysroot ${CMAKE_IOS_SDK_ROOT}") + add_compile_options(-fembed-bitcode) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") else() #iOS Simulator. - add_compile_options(-mios-simulator-version-min=11.0) + add_compile_options(-mios-simulator-version-min=9.0) # isysroot is the result from running -> xcodebuild -version -sdk iphonesimulator Path add_compile_options(-isysroot ${CMAKE_IOS_SDK_ROOT}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \ - -mios-simulator-version-min=11.0 -std=gnu99 -isysroot ${CMAKE_IOS_SDK_ROOT}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ - -mios-simulator-version-min=11.0 -std=gnu++11 -isysroot ${CMAKE_IOS_SDK_ROOT}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") endif() else() set(IOS_DEPLOYMENT_TARGET "$ENV{IPHONEOS_DEPLOYMENT_TARGET}") diff --git a/tools/ios-framework/nodeLib.xcodeproj/project.pbxproj b/tools/ios-framework/NodeMobile.xcodeproj/project.pbxproj similarity index 87% rename from tools/ios-framework/nodeLib.xcodeproj/project.pbxproj rename to tools/ios-framework/NodeMobile.xcodeproj/project.pbxproj index 1e54efa0e54..cbb2ee6008a 100644 --- a/tools/ios-framework/nodeLib.xcodeproj/project.pbxproj +++ b/tools/ios-framework/NodeMobile.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 3C02AFD41FA919C30053C191 /* NodeMobile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C02AFD31FA919C30053C191 /* NodeMobile.cpp */; }; D9A7619D1F7C63A8006AFE86 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 331917C21EC4702A00F93D52 /* CoreFoundation.framework */; }; D9A7619E1F7C63A8006AFE86 /* libcares.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3376C9191EC3922F0007AD59 /* libcares.a */; }; D9A7619F1F7C63A8006AFE86 /* libChakraCoreStatic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3376C91A1EC3922F0007AD59 /* libChakraCoreStatic.a */; }; @@ -17,8 +18,7 @@ D9A761A41F7C63A8006AFE86 /* libopenssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3376C91E1EC3922F0007AD59 /* libopenssl.a */; }; D9A761A51F7C63A8006AFE86 /* libuv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3376C91F1EC3922F0007AD59 /* libuv.a */; }; D9A761A61F7C63A8006AFE86 /* libzlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3376C9201EC3922F0007AD59 /* libzlib.a */; }; - D9A762281F7C675E006097B1 /* libnode.h in Headers */ = {isa = PBXBuildFile; fileRef = D9A762261F7C674F006097B1 /* libnode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D9A762291F7C675E006097B1 /* node.hpp in Headers */ = {isa = PBXBuildFile; fileRef = D9A762271F7C674F006097B1 /* node.hpp */; settings = {ATTRIBUTES = (Public, ); }; }; + D9A762281F7C675E006097B1 /* NodeMobile.h in Headers */ = {isa = PBXBuildFile; fileRef = D9A762261F7C674F006097B1 /* NodeMobile.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -32,10 +32,10 @@ 3376C91E1EC3922F0007AD59 /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenssl.a; path = bin/libopenssl.a; sourceTree = ""; }; 3376C91F1EC3922F0007AD59 /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = bin/libuv.a; sourceTree = ""; }; 3376C9201EC3922F0007AD59 /* libzlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzlib.a; path = bin/libzlib.a; sourceTree = ""; }; - D9A761AE1F7C63A8006AFE86 /* libnode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libnode.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3C02AFD31FA919C30053C191 /* NodeMobile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NodeMobile.cpp; sourceTree = ""; }; + D9A761AE1F7C63A8006AFE86 /* NodeMobile.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NodeMobile.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D9A762251F7C674F006097B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D9A762261F7C674F006097B1 /* libnode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libnode.h; sourceTree = ""; }; - D9A762271F7C674F006097B1 /* node.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = node.hpp; sourceTree = ""; }; + D9A762261F7C674F006097B1 /* NodeMobile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NodeMobile.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,7 +62,7 @@ 3376C9031EC391130007AD59 = { isa = PBXGroup; children = ( - D9A762241F7C674F006097B1 /* libnode */, + D9A762241F7C674F006097B1 /* NodeMobile */, 3376C90E1EC391130007AD59 /* Products */, 3376C9181EC3922E0007AD59 /* Frameworks */, ); @@ -71,7 +71,7 @@ 3376C90E1EC391130007AD59 /* Products */ = { isa = PBXGroup; children = ( - D9A761AE1F7C63A8006AFE86 /* libnode.framework */, + D9A761AE1F7C63A8006AFE86 /* NodeMobile.framework */, ); name = Products; sourceTree = ""; @@ -93,14 +93,14 @@ name = Frameworks; sourceTree = ""; }; - D9A762241F7C674F006097B1 /* libnode */ = { + D9A762241F7C674F006097B1 /* NodeMobile */ = { isa = PBXGroup; children = ( D9A762251F7C674F006097B1 /* Info.plist */, - D9A762261F7C674F006097B1 /* libnode.h */, - D9A762271F7C674F006097B1 /* node.hpp */, + D9A762261F7C674F006097B1 /* NodeMobile.h */, + 3C02AFD31FA919C30053C191 /* NodeMobile.cpp */, ); - path = libnode; + path = NodeMobile; sourceTree = ""; }; /* End PBXGroup section */ @@ -110,17 +110,16 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - D9A762281F7C675E006097B1 /* libnode.h in Headers */, - D9A762291F7C675E006097B1 /* node.hpp in Headers */, + D9A762281F7C675E006097B1 /* NodeMobile.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - D9A7619A1F7C63A8006AFE86 /* libnode */ = { + D9A7619A1F7C63A8006AFE86 /* NodeMobile */ = { isa = PBXNativeTarget; - buildConfigurationList = D9A761AB1F7C63A8006AFE86 /* Build configuration list for PBXNativeTarget "libnode" */; + buildConfigurationList = D9A761AB1F7C63A8006AFE86 /* Build configuration list for PBXNativeTarget "NodeMobile" */; buildPhases = ( D9A7619B1F7C63A8006AFE86 /* Sources */, D9A7619C1F7C63A8006AFE86 /* Frameworks */, @@ -131,9 +130,9 @@ ); dependencies = ( ); - name = libnode; + name = NodeMobile; productName = nodeLib; - productReference = D9A761AE1F7C63A8006AFE86 /* libnode.framework */; + productReference = D9A761AE1F7C63A8006AFE86 /* NodeMobile.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -150,7 +149,7 @@ }; }; }; - buildConfigurationList = 3376C9071EC391130007AD59 /* Build configuration list for PBXProject "nodeLib" */; + buildConfigurationList = 3376C9071EC391130007AD59 /* Build configuration list for PBXProject "NodeMobile" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -162,7 +161,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - D9A7619A1F7C63A8006AFE86 /* libnode */, + D9A7619A1F7C63A8006AFE86 /* NodeMobile */, ); }; /* End PBXProject section */ @@ -182,6 +181,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3C02AFD41FA919C30053C191 /* NodeMobile.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -236,7 +236,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -289,7 +289,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -303,6 +303,7 @@ D9A761AC1F7C63A8006AFE86 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CODE_SIGN_STYLE = Automatic; @@ -313,9 +314,9 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; - INFOPLIST_FILE = libnode/Info.plist; + INFOPLIST_FILE = NodeMobile/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -327,7 +328,7 @@ "-v", "-lstdc++", ); - PRODUCT_BUNDLE_IDENTIFIER = com.janeasystems.libnode; + PRODUCT_BUNDLE_IDENTIFIER = com.janeasystems.NodeMobile; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SEPARATE_STRIP = YES; @@ -340,6 +341,7 @@ D9A761AD1F7C63A8006AFE86 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CODE_SIGN_STYLE = Automatic; @@ -350,9 +352,9 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; - INFOPLIST_FILE = libnode/Info.plist; + INFOPLIST_FILE = NodeMobile/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -364,7 +366,7 @@ "-v", "-lstdc++", ); - PRODUCT_BUNDLE_IDENTIFIER = com.janeasystems.libnode; + PRODUCT_BUNDLE_IDENTIFIER = com.janeasystems.NodeMobile; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SEPARATE_STRIP = YES; @@ -377,7 +379,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 3376C9071EC391130007AD59 /* Build configuration list for PBXProject "nodeLib" */ = { + 3376C9071EC391130007AD59 /* Build configuration list for PBXProject "NodeMobile" */ = { isa = XCConfigurationList; buildConfigurations = ( 3376C9131EC391130007AD59 /* Debug */, @@ -386,7 +388,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - D9A761AB1F7C63A8006AFE86 /* Build configuration list for PBXNativeTarget "libnode" */ = { + D9A761AB1F7C63A8006AFE86 /* Build configuration list for PBXNativeTarget "NodeMobile" */ = { isa = XCConfigurationList; buildConfigurations = ( D9A761AC1F7C63A8006AFE86 /* Debug */, diff --git a/tools/ios-framework/libnode/Info.plist b/tools/ios-framework/NodeMobile/Info.plist similarity index 100% rename from tools/ios-framework/libnode/Info.plist rename to tools/ios-framework/NodeMobile/Info.plist diff --git a/tools/ios-framework/NodeMobile/NodeMobile.cpp b/tools/ios-framework/NodeMobile/NodeMobile.cpp new file mode 100644 index 00000000000..48f6e233e19 --- /dev/null +++ b/tools/ios-framework/NodeMobile/NodeMobile.cpp @@ -0,0 +1,10 @@ + +#import "NodeMobile.h" + +namespace node { + int Start(int argc, char *argv[]); +} // namespace node + +int node_start(int argc, char *argv[]) { + return node::Start(argc, argv); +} diff --git a/tools/ios-framework/NodeMobile/NodeMobile.h b/tools/ios-framework/NodeMobile/NodeMobile.h new file mode 100644 index 00000000000..ee8b96792a6 --- /dev/null +++ b/tools/ios-framework/NodeMobile/NodeMobile.h @@ -0,0 +1,10 @@ + +#ifdef __cplusplus +extern "C" { +#endif + +int node_start(int argc, char *argv[]); + +#ifdef __cplusplus +} +#endif diff --git a/tools/ios-framework/libnode/libnode.h b/tools/ios-framework/libnode/libnode.h deleted file mode 100644 index d30b7236430..00000000000 --- a/tools/ios-framework/libnode/libnode.h +++ /dev/null @@ -1,9 +0,0 @@ -#import - -//! Project version number for libnode. -FOUNDATION_EXPORT double libnodeVersionNumber; - -//! Project version string for libnode. -FOUNDATION_EXPORT const unsigned char libnodeVersionString[]; - -#import "node.hpp" diff --git a/tools/ios-framework/libnode/node.hpp b/tools/ios-framework/libnode/node.hpp deleted file mode 100644 index c9932b742cf..00000000000 --- a/tools/ios-framework/libnode/node.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef node_hpp -#define node_hpp - -namespace node { - int Start(int argc, char *argv[]); -} // namespace node - -#endif /* node_hpp */ - - diff --git a/tools/ios_framework_prepare.sh b/tools/ios_framework_prepare.sh index 05dd99736a1..8bac4ba5bf5 100755 --- a/tools/ios_framework_prepare.sh +++ b/tools/ios_framework_prepare.sh @@ -18,7 +18,7 @@ make clean TARGET_LIBRARY_PATH='tools/ios-framework/bin/arm64' ./configure --dest-os=ios --dest-cpu=arm64 --without-chakra-jit --enable-static --with-intl=none --openssl-no-asm -make +make -j$(getconf _NPROCESSORS_ONLN) mkdir -p $TARGET_LIBRARY_PATH @@ -37,7 +37,7 @@ make clean TARGET_LIBRARY_PATH='tools/ios-framework/bin/x64' ./configure --dest-os=ios --dest-cpu=x64 --without-chakra-jit --enable-static --with-intl=none --openssl-no-asm -make +make -j$(getconf _NPROCESSORS_ONLN) mkdir -p $TARGET_LIBRARY_PATH @@ -64,6 +64,7 @@ lipo -create "$TARGET_LIBRARY_PATH/arm64/libuv.a" "$TARGET_LIBRARY_PATH/x64/libu lipo -create "$TARGET_LIBRARY_PATH/arm64/libzlib.a" "$TARGET_LIBRARY_PATH/x64/libzlib.a" -output "$TARGET_LIBRARY_PATH/libzlib.a" #Create a path to build the frameworks into +rm -rf out_ios mkdir -p out_ios cd out_ios FRAMEWORK_TARGET_DIR=${PWD} @@ -71,10 +72,10 @@ cd ../ NODELIB_PROJECT_PATH='tools/ios-framework' -xcodebuild build -project $NODELIB_PROJECT_PATH/nodeLib.xcodeproj -target "libnode" -configuration Release -arch arm64 -sdk "iphoneos" SYMROOT=$FRAMEWORK_TARGET_DIR -xcodebuild build -project $NODELIB_PROJECT_PATH/nodeLib.xcodeproj -target "libnode" -configuration Release -arch x86_64 -sdk "iphonesimulator" SYMROOT=$FRAMEWORK_TARGET_DIR +xcodebuild build -project $NODELIB_PROJECT_PATH/NodeMobile.xcodeproj -target "NodeMobile" -configuration Release -arch arm64 -sdk "iphoneos" SYMROOT=$FRAMEWORK_TARGET_DIR +xcodebuild build -project $NODELIB_PROJECT_PATH/NodeMobile.xcodeproj -target "NodeMobile" -configuration Release -arch x86_64 -sdk "iphonesimulator" SYMROOT=$FRAMEWORK_TARGET_DIR cp -RL $FRAMEWORK_TARGET_DIR/Release-iphoneos $FRAMEWORK_TARGET_DIR/Release-universal -lipo -create $FRAMEWORK_TARGET_DIR/Release-iphoneos/libnode.framework/libnode $FRAMEWORK_TARGET_DIR/Release-iphonesimulator/libnode.framework/libnode -output $FRAMEWORK_TARGET_DIR/Release-universal/libnode.framework/libnode +lipo -create $FRAMEWORK_TARGET_DIR/Release-iphoneos/NodeMobile.framework/NodeMobile $FRAMEWORK_TARGET_DIR/Release-iphonesimulator/NodeMobile.framework/NodeMobile -output $FRAMEWORK_TARGET_DIR/Release-universal/NodeMobile.framework/NodeMobile echo "Frameworks built to $FRAMEWORK_TARGET_DIR"