Skip to content
Browse files

update gyp configs for ios

  • Loading branch information...
1 parent ab80487 commit 2e61cd6f4a422599c9dadcc2a72c828ffa2672d4 @changchang changchang committed
Showing with 192 additions and 447 deletions.
  1. +49 −21 deps/jansson/jansson.gyp
  2. +16 −175 deps/uv/uv.gyp
  3. +126 −250 pomelo.gyp
  4. +1 −1 pomelo_gyp
View
70 deps/jansson/jansson.gyp
@@ -1,4 +1,25 @@
{
+ 'conditions': [
+ ['TO == "ios"', {
+ 'xcode_settings': {
+ 'SDKROOT': 'iphoneos',
+ }, # xcode_settings
+ }], # TO == "ios"
+ ], # conditions
+
+ 'target_defaults': {
+ 'conditions': [
+ ['TO == "ios"', {
+ 'xcode_settings': {
+ 'TARGETED_DEVICE_FAMILY': '1,2',
+ 'CODE_SIGN_IDENTITY': 'iPhone Developer',
+ 'IPHONEOS_DEPLOYMENT_TARGET': '5.0',
+ 'ARCHS': '$(ARCHS_STANDARD_32_64_BIT)',
+ },
+ }], # TO == "ios"
+ ], # conditions
+ },
+
'targets': [
{
'target_name': 'jansson',
@@ -25,28 +46,35 @@
'src/jansson_config.h'
],
'conditions': [
- ['OS == "win"', {
- 'defines': [
- 'WIN32',
- '_CRT_NONSTDC_NO_DEPRECATE',
- '_DEBUG',
- '_WINDOWS',
- '_USRDLL',
- 'JANSSON_DLL_EXPORTS',
- '_WINDLL',
- '_UNICODE',
- 'UNICODE'
- ]
- }],
- ['OS != "win"',{
- 'ldflags': [
- '-no-undefined',
- '-export-symbols-regex \'^json_\'',
- '-version-info 8:0:4',
- ]
- }
+ ['OS == "win"', {
+ 'defines': [
+ 'WIN32',
+ '_CRT_NONSTDC_NO_DEPRECATE',
+ '_DEBUG',
+ '_WINDOWS',
+ '_USRDLL',
+ 'JANSSON_DLL_EXPORTS',
+ '_WINDLL',
+ '_UNICODE',
+ 'UNICODE'
]
- ],
+ }], # OS == "win"
+ ['OS=="ios"', {
+ 'xcode_settings': {
+ 'TARGETED_DEVICE_FAMILY': '1,2',
+ 'CODE_SIGN_IDENTITY': 'iPhone Developer',
+ 'IPHONEOS_DEPLOYMENT_TARGET': '5.0',
+ 'ARCHS': '$(ARCHS_STANDARD_32_64_BIT)',
+ }, # xcode_settings
+ }], # OS=="ios"
+ ['OS != "win"',{
+ 'ldflags': [
+ '-no-undefined',
+ '-export-symbols-regex \'^json_\'',
+ '-version-info 8:0:4',
+ ]
+ }], # OS != "win"
+ ], # conditions
},
],
}
View
191 deps/uv/uv.gyp
@@ -1,6 +1,22 @@
{
+ 'conditions': [
+ ['TO == "ios"', {
+ 'xcode_settings': {
+ 'SDKROOT': 'iphoneos',
+ }, # xcode_settings
+ }], # TO == "ios"
+ ], # conditions
+
'target_defaults': {
'conditions': [
+ ['TO == "ios"', {
+ 'xcode_settings': {
+ 'TARGETED_DEVICE_FAMILY': '1,2',
+ 'CODE_SIGN_IDENTITY': 'iPhone Developer',
+ 'IPHONEOS_DEPLOYMENT_TARGET': '5.0',
+ 'ARCHS': '$(ARCHS_STANDARD_32_64_BIT)',
+ },
+ }], # TO == "ios"
['OS != "win"', {
'defines': [
'_LARGEFILE_SOURCE',
@@ -235,181 +251,6 @@
}]
]
},
-
- {
- 'target_name': 'run-tests',
- 'type': 'executable',
- 'dependencies': [ 'libuv' ],
- 'sources': [
- 'test/blackhole-server.c',
- 'test/echo-server.c',
- 'test/run-tests.c',
- 'test/runner.c',
- 'test/runner.h',
- 'test/test-get-loadavg.c',
- 'test/task.h',
- 'test/test-util.c',
- 'test/test-active.c',
- 'test/test-async.c',
- 'test/test-callback-stack.c',
- 'test/test-callback-order.c',
- 'test/test-connection-fail.c',
- 'test/test-cwd-and-chdir.c',
- 'test/test-delayed-accept.c',
- 'test/test-error.c',
- 'test/test-embed.c',
- 'test/test-fail-always.c',
- 'test/test-fs.c',
- 'test/test-fs-event.c',
- 'test/test-get-currentexe.c',
- 'test/test-get-memory.c',
- 'test/test-getaddrinfo.c',
- 'test/test-getsockname.c',
- 'test/test-hrtime.c',
- 'test/test-idle.c',
- 'test/test-ipc.c',
- 'test/test-ipc-send-recv.c',
- 'test/test-list.h',
- 'test/test-loop-handles.c',
- 'test/test-walk-handles.c',
- 'test/test-multiple-listen.c',
- 'test/test-pass-always.c',
- 'test/test-ping-pong.c',
- 'test/test-pipe-bind-error.c',
- 'test/test-pipe-connect-error.c',
- 'test/test-platform-output.c',
- 'test/test-poll.c',
- 'test/test-poll-close.c',
- 'test/test-process-title.c',
- 'test/test-ref.c',
- 'test/test-run-nowait.c',
- 'test/test-run-once.c',
- 'test/test-semaphore.c',
- 'test/test-shutdown-close.c',
- 'test/test-shutdown-eof.c',
- 'test/test-signal.c',
- 'test/test-signal-multiple-loops.c',
- 'test/test-spawn.c',
- 'test/test-fs-poll.c',
- 'test/test-stdio-over-pipes.c',
- 'test/test-tcp-bind-error.c',
- 'test/test-tcp-bind6-error.c',
- 'test/test-tcp-close.c',
- 'test/test-tcp-close-while-connecting.c',
- 'test/test-tcp-connect-error-after-write.c',
- 'test/test-tcp-shutdown-after-write.c',
- 'test/test-tcp-flags.c',
- 'test/test-tcp-connect-error.c',
- 'test/test-tcp-connect-timeout.c',
- 'test/test-tcp-connect6-error.c',
- 'test/test-tcp-open.c',
- 'test/test-tcp-write-to-half-open-connection.c',
- 'test/test-tcp-writealot.c',
- 'test/test-tcp-unexpected-read.c',
- 'test/test-tcp-read-stop.c',
- 'test/test-threadpool.c',
- 'test/test-threadpool-cancel.c',
- 'test/test-mutexes.c',
- 'test/test-thread.c',
- 'test/test-barrier.c',
- 'test/test-condvar.c',
- 'test/test-timer-again.c',
- 'test/test-timer.c',
- 'test/test-tty.c',
- 'test/test-udp-dgram-too-big.c',
- 'test/test-udp-ipv6.c',
- 'test/test-udp-open.c',
- 'test/test-udp-options.c',
- 'test/test-udp-send-and-recv.c',
- 'test/test-udp-multicast-join.c',
- 'test/test-dlerror.c',
- 'test/test-udp-multicast-ttl.c',
- ],
- 'conditions': [
- [ 'OS=="win"', {
- 'sources': [
- 'test/runner-win.c',
- 'test/runner-win.h'
- ],
- 'libraries': [ 'ws2_32.lib' ]
- }, { # POSIX
- 'defines': [ '_GNU_SOURCE' ],
- 'sources': [
- 'test/runner-unix.c',
- 'test/runner-unix.h',
- ],
- }],
- [ 'OS=="solaris"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
- 'defines': [
- '__EXTENSIONS__',
- '_XOPEN_SOURCE=500',
- ],
- }],
- [ 'OS=="aix"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
- 'defines': [
- '_ALL_SOURCE',
- '_XOPEN_SOURCE=500',
- ],
- }],
- ],
- 'msvs-settings': {
- 'VCLinkerTool': {
- 'SubSystem': 1, # /subsystem:console
- },
- },
- },
-
- {
- 'target_name': 'run-benchmarks',
- 'type': 'executable',
- 'dependencies': [ 'libuv' ],
- 'sources': [
- 'test/benchmark-async.c',
- 'test/benchmark-async-pummel.c',
- 'test/benchmark-fs-stat.c',
- 'test/benchmark-getaddrinfo.c',
- 'test/benchmark-list.h',
- 'test/benchmark-loop-count.c',
- 'test/benchmark-million-async.c',
- 'test/benchmark-million-timers.c',
- 'test/benchmark-multi-accept.c',
- 'test/benchmark-ping-pongs.c',
- 'test/benchmark-pound.c',
- 'test/benchmark-pump.c',
- 'test/benchmark-sizes.c',
- 'test/benchmark-spawn.c',
- 'test/benchmark-thread.c',
- 'test/benchmark-tcp-write-batch.c',
- 'test/benchmark-udp-pummel.c',
- 'test/dns-server.c',
- 'test/echo-server.c',
- 'test/blackhole-server.c',
- 'test/run-benchmarks.c',
- 'test/runner.c',
- 'test/runner.h',
- 'test/task.h',
- ],
- 'conditions': [
- [ 'OS=="win"', {
- 'sources': [
- 'test/runner-win.c',
- 'test/runner-win.h',
- ],
- 'libraries': [ 'ws2_32.lib' ]
- }, { # POSIX
- 'defines': [ '_GNU_SOURCE' ],
- 'sources': [
- 'test/runner-unix.c',
- 'test/runner-unix.h',
- ]
- }]
- ],
- 'msvs-settings': {
- 'VCLinkerTool': {
- 'SubSystem': 1, # /subsystem:console
- },
- },
- }
]
}
View
376 pomelo.gyp
@@ -1,4 +1,51 @@
{
+ 'target_defaults': {
+ 'conditions': [
+ ['OS == "win"', {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'AdditionalOptions': [ '/TP' ],
+ }
+ },
+ 'defines': [
+ 'WIN32',
+ '_CRT_NONSTDC_NO_DEPRECATE',
+ '_DEBUG',
+ '_WINDOWS',
+ '_USRDLL',
+ 'JANSSON_DLL_EXPORTS',
+ '_WINDLL',
+ '_UNICODE',
+ 'UNICODE'
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '-ladvapi32.lib',
+ '-liphlpapi.lib',
+ '-lpsapi.lib',
+ '-lshell32.lib',
+ '-lws2_32.lib'
+ ],
+ },
+ }], # OS == "win"
+ ['OS != "win" ',{
+ 'defines':[
+ '_LARGEFILE_SOURCE',
+ '_FILE_OFFSET_BITS=64',
+ '_GNU_SOURCE',
+ ]
+ }], # OS != "win"
+ ['TO == "ios"', {
+ 'xcode_settings': {
+ 'TARGETED_DEVICE_FAMILY': '1,2',
+ 'CODE_SIGN_IDENTITY': 'iPhone Developer',
+ 'IPHONEOS_DEPLOYMENT_TARGET': '5.0',
+ 'ARCHS': '$(ARCHS_STANDARD_32_64_BIT)',
+ },
+ }], # TO == "ios"
+ ], # conditions
+ },
+
'targets': [
{
'target_name': 'libpomelo',
@@ -43,261 +90,90 @@
'src/thread.c',
],
'conditions': [
- ['OS == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'AdditionalOptions': [ '/TP' ],
- }
- },
- 'defines': [
- '_WIN32',
- 'WIN32',
- '_CRT_NONSTDC_NO_DEPRECATE',
- '_DEBUG',
- '_WINDOWS',
- '_USRDLL',
- 'JANSSON_DLL_EXPORTS',
- '_WINDLL',
- '_UNICODE',
- 'UNICODE'
- ],
- 'link_settings': {
- 'libraries': [
- '-ladvapi32.lib',
- '-liphlpapi.lib',
- '-lpsapi.lib',
- '-lshell32.lib',
- '-lws2_32.lib'
- ],
- },
- }
- ],
- ['OS != "win"',{
- 'defines':[
- '_LARGEFILE_SOURCE',
- '_FILE_OFFSET_BITS=64',
- '_GNU_SOURCE',
- ],
- 'ldflags': [
- '-no-undefined',
- '-export-symbols-regex \'^json_\'',
- '-version-info 8:0:4',
- ]
- }
+ ['OS != "win"', {
+ 'ldflags': [
+ '-no-undefined',
+ '-export-symbols-regex \'^json_\'',
+ '-version-info 8:0:4',
]
- ],
+ }] # OS != "win"
+ ], # conditions
},
- {
- 'target_name': 'destroy',
- 'type': 'executable',
- 'dependencies': [
- 'libpomelo',
- ],
- 'include_dirs': [
- 'include/',
- './deps/uv/include',
- './deps/jansson/src',
- ],
- 'sources': [
- 'example/destroy.c'
- ],
- 'conditions' : [
- ['OS == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'AdditionalOptions': [ '/TP' ],
- }
- },
- 'defines': [
- 'WIN32',
- '_CRT_NONSTDC_NO_DEPRECATE',
- '_DEBUG',
- '_WINDOWS',
- '_USRDLL',
- 'JANSSON_DLL_EXPORTS',
- '_WINDLL',
- '_UNICODE',
- 'UNICODE'
+ ], # targets
+
+ 'conditions': [
+ ['TO == "ios"',
+ {
+ 'xcode_settings': {
+ 'SDKROOT': 'iphoneos',
+ }, # xcode_settings
+ },
+ ], # TO == "ios"
+ ['TO == "pc"',
+ {
+ 'targets': [
+ {
+ 'target_name': 'destroy',
+ 'type': 'executable',
+ 'dependencies': [
+ 'libpomelo',
],
- 'link_settings': {
- 'libraries': [
- '-ladvapi32.lib',
- '-liphlpapi.lib',
- '-lpsapi.lib',
- '-lshell32.lib',
- '-lws2_32.lib'
- ],
- },
- }
- ],
- ['OS != "win" ',{
- 'defines':[
- '_LARGEFILE_SOURCE',
- '_FILE_OFFSET_BITS=64',
- '_GNU_SOURCE',
- ]
- }
- ]
- ],
- },
- {
- 'target_name': 'notify',
- 'type': 'executable',
- 'dependencies': [
- 'libpomelo',
- ],
- 'include_dirs': [
- 'include/',
- './deps/uv/include',
- './deps/jansson/src',
- ],
- 'sources': [
- 'example/notify.c'
- ],
- 'conditions':[
- ['OS == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'AdditionalOptions': [ '/TP' ],
- }
- },
- 'defines': [
- 'WIN32',
- '_CRT_NONSTDC_NO_DEPRECATE',
- '_DEBUG',
- '_WINDOWS',
- '_USRDLL',
- 'JANSSON_DLL_EXPORTS',
- '_WINDLL',
- '_UNICODE',
- 'UNICODE'
+ 'include_dirs': [
+ 'include/',
+ './deps/uv/include',
+ './deps/jansson/src',
],
- 'link_settings': {
- 'libraries': [
- '-ladvapi32.lib',
- '-liphlpapi.lib',
- '-lpsapi.lib',
- '-lshell32.lib',
- '-lws2_32.lib'
- ],
- },
- }
- ],
- ['OS != "win" ',{
- 'defines':[
- '_LARGEFILE_SOURCE',
- '_FILE_OFFSET_BITS=64',
- '_GNU_SOURCE',
- ]
- }
- ]
- ]
- },
- {
- 'target_name': 'request',
- 'type': 'executable',
- 'dependencies': [
- 'libpomelo',
- ],
- 'include_dirs': [
- 'include/',
- './deps/uv/include',
- './deps/jansson/src',
- ],
- 'sources': [
- 'example/request.c'
- ],
- 'conditions': [
- ['OS == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'AdditionalOptions': [ '/TP' ],
- }
- },
- 'defines': [
- 'WIN32',
- '_CRT_NONSTDC_NO_DEPRECATE',
- '_DEBUG',
- '_WINDOWS',
- '_USRDLL',
- 'JANSSON_DLL_EXPORTS',
- '_WINDLL',
- '_UNICODE',
- 'UNICODE'
+ 'sources': [
+ 'example/destroy.c'
],
- 'link_settings': {
- 'libraries': [
- '-ladvapi32.lib',
- '-liphlpapi.lib',
- '-lpsapi.lib',
- '-lshell32.lib',
- '-lws2_32.lib'
- ],
- },
- }
- ],
- ['OS != "win" ',{
- 'defines':[
- '_LARGEFILE_SOURCE',
- '_FILE_OFFSET_BITS=64',
- '_GNU_SOURCE',
- ]
- }
- ]
- ]
- },
- {
- 'target_name': 'echo',
- 'type': 'executable',
- 'dependencies': [
- 'libpomelo',
- ],
- 'include_dirs': [
- 'include/',
- './deps/uv/include',
- './deps/jansson/src',
- ],
- 'sources': [
- 'example/echo.c'
- ],
- 'conditions': [
- ['OS == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'AdditionalOptions': [ '/TP' ],
- }
- },
- 'defines': [
- 'WIN32',
- '_CRT_NONSTDC_NO_DEPRECATE',
- '_DEBUG',
- '_WINDOWS',
- '_USRDLL',
- 'JANSSON_DLL_EXPORTS',
- '_WINDLL',
- '_UNICODE',
- 'UNICODE'
+ },
+ {
+ 'target_name': 'notify',
+ 'type': 'executable',
+ 'dependencies': [
+ 'libpomelo',
],
- 'link_settings': {
- 'libraries': [
- '-ladvapi32.lib',
- '-liphlpapi.lib',
- '-lpsapi.lib',
- '-lshell32.lib',
- '-lws2_32.lib'
- ],
- },
- }
- ],
- ['OS != "win" ',{
- 'defines':[
- '_LARGEFILE_SOURCE',
- '_FILE_OFFSET_BITS=64',
- '_GNU_SOURCE',
- ]
- }
+ 'include_dirs': [
+ 'include/',
+ './deps/uv/include',
+ './deps/jansson/src',
+ ],
+ 'sources': [
+ 'example/notify.c'
+ ],
+ },
+ {
+ 'target_name': 'request',
+ 'type': 'executable',
+ 'dependencies': [
+ 'libpomelo',
+ ],
+ 'include_dirs': [
+ 'include/',
+ './deps/uv/include',
+ './deps/jansson/src',
+ ],
+ 'sources': [
+ 'example/request.c'
+ ],
+ },
+ {
+ 'target_name': 'echo',
+ 'type': 'executable',
+ 'dependencies': [
+ 'libpomelo',
+ ],
+ 'include_dirs': [
+ 'include/',
+ './deps/uv/include',
+ './deps/jansson/src',
+ ],
+ 'sources': [
+ 'example/echo.c'
+ ],
+ },
]
- ]
- }
- ],
+ }
+ ] # TO == pc
+ ], # conditions
}
View
2 pomelo_gyp
@@ -1 +1 @@
-gyp --depth=. pomelo.gyp -Dlibrary=static_library $@
+gyp --depth=. pomelo.gyp -Dlibrary=static_library -DTO=pc $@

0 comments on commit 2e61cd6

Please sign in to comment.
Something went wrong with that request. Please try again.