Method: Pindo::CommonConfuseProj#process_config_setting

Defined in:
lib/pindo/module/build/commonconfuseproj.rb

#process_config_setting(clang_path: nil, config: nil, default_type: "symash1") ⇒ Object



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/pindo/module/build/commonconfuseproj.rb', line 204

def process_config_setting(clang_path:nil, config:nil, default_type:"symash1")

    # config.build_settings["VALID_ARCHS"] = "arm64 armv7 armv7s"
    config.build_settings["VALID_ARCHS"] = "arm64"
    if default_type == "symash1"
        config.build_settings["CC"] = "#{clang_path}/bin/symasher"
    else
        config.build_settings["CC"] = "#{clang_path}/bin/clang"
    end
    
    config.build_settings["ENABLE_BITCODE"] = "NO"

    macros=config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"]
    case macros
        
    when nil
        macros = ["$(inherited)"]
        when String
            if macros != "$(inherited)" then
                macros = ["$(inherited)", macros]
            else
                macros = ["$(inherited)"]
            end
        else
    end

    #移除SYMASH_...
    macros.delete_if { |macro| macro.index("SYMASH_") == 0 }

    #重新安装
    macros << "SYMASH_PODS_ROOT=$(PODS_ROOT)" << "SYMASH_TARGET_NAME=$(TARGET_NAME)" << "__SYMASH_XCODE__"

    #外部路径
    temp_external_hash = @external_sources_hash
    case temp_external_hash
    when Hash
        temp_external_hash.each { |name, source|
          # 当pod由{:git,:commit}引入时不计为external
          if source[:path] != nil then
            macros << "SYMASH_EXTPOD_"+name+"="+source[:path]
          end
    }
    end
    config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"] = macros

    setting_item = config.build_settings["OTHER_CFLAGS"] || []
    if setting_item == ""
        setting_item = []
    end
    unless setting_item.to_s.index "inherited"
        setting_item << "$(inherited)"
    end
    # unless setting_item.to_s.index "-fvisibility=hidden"
    #     setting_item << " -fvisibility=hidden"
    # end
    config.build_settings["OTHER_CFLAGS"] = setting_item
    
    # config.build_settings["OTHER_CPLUSPLUSFLAGS"] = config.build_settings["OTHER_CPLUSPLUSFLAGS"] || []
    # config.build_settings["OTHER_CPLUSPLUSFLAGS"] << "$(inherited)"
    # config.build_settings["OTHER_CPLUSPLUSFLAGS"] << "$(OTHER_CFLAGS)"

    # config.build_settings["LD"] = "/usr/bin/clang"


end