Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed building pods containing *.c sources #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions Examples/PodSpecs/nanopb.podspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "nanopb",
"version": "1.30906.0",
"summary": "Protocol buffers with small code size.",
"description": "Nanopb is a small code-size Protocol Buffers implementation\nin ansi C. It is especially suitable for use in\nmicrocontrollers, but fits any memory restricted system.",
"homepage": "https://github.com/nanopb/nanopb",
"license": {
"type": "zlib",
"file": "LICENSE.txt"
},
"authors": {
"Petteri Aimonen": "[email protected]"
},
"source": {
"git": "https://github.com/nanopb/nanopb.git",
"tag": "0.3.9.6"
},
"requires_arc": false,
"xcconfig": {
"GCC_PREPROCESSOR_DEFINITIONS": "$(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1"
},
"source_files": "*.{h,c}",
"public_header_files": "*.h",
"platforms": {
"osx": null,
"ios": null,
"tvos": null,
"watchos": null
},
"subspecs": [
{
"name": "encode",
"public_header_files": [
"pb.h",
"pb_encode.h",
"pb_common.h"
],
"source_files": [
"pb.h",
"pb_common.h",
"pb_common.c",
"pb_encode.h",
"pb_encode.c"
]
},
{
"name": "decode",
"public_header_files": [
"pb.h",
"pb_decode.h",
"pb_common.h"
],
"source_files": [
"pb.h",
"pb_common.h",
"pb_common.c",
"pb_decode.h",
"pb_decode.c"
]
}
]
}
6 changes: 3 additions & 3 deletions Sources/PodToBUILD/ObjcLibrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,15 @@ public struct ObjcLibrary: BazelTarget, UserConfigurable, SourceExcludable {
// Logically, this segment of the code is identical to the ruby
// code. It would look like:
// return boolValue ? arcSources : GlobNode.empty
// however, bazel native rules don't allow cpp inside of the
// `non_arc_sourcs`. The following code opts in cpp sources only.
// however, bazel native rules don't allow cpp and c inside of the
// `non_arc_sourcs`. The following code opts in cpp and c sources only.
// the fobjc-arc _feature_ does not apply to the cpp language
// inside of clang
return boolValue ? arcSources : GlobNode(include: arcSources.include.map {
$0.compactMapInclude {
incPart -> String? in
let suffix = String(incPart.split(separator: ".").last!)
if suffix == "cpp" || suffix == "cxx" || suffix == "cc" {
if suffix == "cpp" || suffix == "cxx" || suffix == "cc" || suffix == "c" {
return incPart
}
return nil
Expand Down