ourfor / blog

利用GitHub的Issues记录
https://github.com/ourfor/blog/issues
1 stars 0 forks source link

Xcode配置文件 #73

Open ourfor opened 2 years ago

ourfor commented 2 years ago

project.yml

name: Redis
options:
  bundleIdPrefix: top.ourfor.opensource
targets:
  Redis-Server:
    type: tool
    platform: macOS
    deploymentTarget: 10.15
    sources:
      - path: src
        name: Server
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)"
        buildPhase: none
    preBuildScripts:
      - script: rm -rf $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME
        name: Remove Build
      - script: /usr/bin/make
        name: Makefile Build
    postCompileScripts:
      - script: cp $PROJECT_DIR/src/redis-server $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME
        name: Copy Executable
  Dummy:
    type: tool
    platform: macOS
    deploymentTarget: 10.15
    sources:
      - path: src
        name: Source
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)"
schemes:
  Redis-Server:
    build:
      targets:
        Redis-Server: [run]
    run:
      debugEnabled: true
      commandLineArguments:
        "--loglevel verbose": true
        "--port 7777": false
      environmentVariables:
        MY_ENV_VAR: VALUE

通过xcodegen生成配置文件

brew install xcodegen
xcodegen
ourfor commented 2 years ago

Nginx

name: Nginx
options:
  bundleIdPrefix: top.ourfor.opensource
targets:
  Nginx-Server:
    type: tool
    platform: macOS
    deploymentTarget: 10.15
    sources:
      - path: src
        name: Server
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)"
        buildPhase: none
    preBuildScripts:
      - script: rm -rf $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME
        name: Remove Build
      - script: /usr/bin/make
        name: Makefile Build
    postCompileScripts:
      - script: cp $PROJECT_DIR/objs/nginx $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME
        name: Copy Executable
  Dummy:
    type: tool
    platform: macOS
    deploymentTarget: 10.15
    sources:
      - path: src
        name: Source
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)" 
schemes:
  Nginx:
    build:
      targets:
        Nginx-Server: [run]
    run:
      debugEnabled: true
      commandLineArguments:
        "--loglevel verbose": false
        "--port 7777": false
      environmentVariables:
        MY_ENV_VAR: VALUE
ourfor commented 1 year ago

Nginx添加模块配置文件

name: Nginx
options:
  bundleIdPrefix: top.ourfor.opensource
settings:
  HEADER_SEARCH_PATHS: $SRCROOT/src/**
targets:
  Nginx-Server:
    type: tool
    platform: macOS
    deploymentTarget: 10.15
    sources:
      - path: src
        name: Server
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)"
        buildPhase: none
    preBuildScripts:
      - script: rm -rf $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME
        name: Remove Build
      - script: /usr/bin/make && /usr/bin/make install
        name: Makefile Build
    postCompileScripts:
      - script: cp $PROJECT_DIR/objs/nginx $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME
        name: Copy Executable
  Dummy:
    type: tool
    platform: macOS
    deploymentTarget: 10.15
    sources:
      - path: src
        name: Source
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)"
      - path: module
        name: Module
        includes:
          - "**/*.[ch]"
          - "**/*.(cpp|hpp)"  
schemes:
  Nginx:
    build:
      targets:
        Nginx-Server: [run]
    run:
      debugEnabled: true
      commandLineArguments:
        "--loglevel verbose": false
        "--port 7777": false
      environmentVariables:
        MY_ENV_VAR: VALUE

同时启用动态链接库debug: ./configure --prefix=/tmp/nginx --with-debug --add-dynamic-module=module/hello