@@ -122,34 +122,32 @@ jobs:
122
122
mkdir -p packaging-tools
123
123
cp -af /tmp/binutils-output/bin/* packaging-tools
124
124
125
- - name : Cache LLVM (Mac only)
126
- if : matrix.tools_platform == 'darwin'
125
+ - name : Cache LLVM
127
126
id : cache_llvm
128
127
uses : actions/cache@v3
129
128
with :
130
129
path : llvm-src/llvm/build/bin
131
- key : llvm-bin-${{matrix.tools_platform}}- ${{env.xcodeVersion}}-${{env.llvmVer}}
130
+ key : llvm-bin-${{matrix.tools_platform}}${{matrix.tools_platform == 'darwin' && format('-{0}', env.xcodeVersion) || '' }}-${{env.llvmVer}}
132
131
133
- - name : Fetch LLVM source (Mac only)
132
+ - name : Fetch LLVM source
134
133
# Only fetch LLVM if we don't already have binaries from the cache.
135
- if : ${{ matrix.tools_platform == 'darwin' && !steps.cache_llvm.outputs.cache-hit }}
134
+ if : ${{ !steps.cache_llvm.outputs.cache-hit }}
136
135
uses : actions/checkout@v3
137
136
with :
138
137
repository : llvm/llvm-project
139
138
path : llvm-src
140
139
ref : ${{ env.llvmVer }}
141
140
142
- - name : Build LLVM (Mac only)
141
+ - name : Build LLVM
143
142
# Only build LLVM if we don't already have binaries from the cache.
144
- if : ${{ matrix.tools_platform == 'darwin' && !steps.cache_llvm.outputs.cache-hit }}
143
+ if : ${{ !steps.cache_llvm.outputs.cache-hit }}
145
144
run : |
146
145
mkdir llvm-src/llvm/build
147
146
cd llvm-src/llvm/build
148
147
cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release ..
149
148
cmake --build . -j 3 --target llvm-objcopy --target llvm-nm --target llvm-ar
150
149
151
- - name : Package LLVM output (Mac only)
152
- if : matrix.tools_platform == 'darwin'
150
+ - name : Package LLVM output
153
151
run : |
154
152
mkdir -p packaging-tools
155
153
cp -af llvm-src/llvm/build/bin/* packaging-tools
@@ -555,17 +553,10 @@ jobs:
555
553
# determine the build variant based on the artifact filename
556
554
variant=$(sdk-src/build_scripts/desktop/get_variant.sh "${pkg}")
557
555
additional_flags=(${verbose_flag})
558
- # Several build targets require explicitly-set binutils format to be passed
559
- # to package.sh (and thus, to merge_libraries), or use LLVM binutils.
560
- if [[ "${{ matrix.sdk_platform }}" == "darwin" ]]; then
561
- # MacOS: use LLVM binutils for both X64 and ARM64
556
+ # Several build targets require to use LLVM binutils.
557
+ if [[ "${{ matrix.sdk_platform }}" == "darwin" || ${{ matrix.sdk_platform }}" == "windows" ]]; then
558
+ # MacOS/Windows: use LLVM binutils for all architectures
562
559
additional_flags+=(-L)
563
- elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x64/"* ]]; then
564
- # Windows x64: force input and output target format
565
- additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64)
566
- elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x86/"* ]]; then
567
- # Windows x86: force input and output target format
568
- additional_flags+=(-f pe-i386,pe-bigobj-i386)
569
560
fi
570
561
sdk-src/build_scripts/desktop/package.sh -b ${pkg} -o firebase-cpp-sdk-${{ matrix.sdk_platform }}${{ matrix.suffix }}-package -p ${{ matrix.sdk_platform }} -t bin -d ${variant} -P python3 -j ${additional_flags[*]}
571
562
done
0 commit comments