Skip to content

Commit 58b4e14

Browse files
authored
Remove CMake warning: jobserver unavailable: using -j1. Add `+' to parent make rule. (#7334)
## Summary of changes This PR removes the CMake warning: jobserver unavailable: using -j1. Add `+' to parent make rule. ## Reason for change The warning is annoying ## Implementation details For recent versions of CMAKE I've added: ``` set_property(TARGET re2 PROPERTY JOB_SERVER_AWARE TRUE) ``` for older versions I've changed the `OSXRE2BUILDCOMMAND` to overwrite the `MAKEFLAGS` environment variable. ## Test coverage If the warning is removed then it worked. ## Other details <!-- Fixes #{issue} --> <!-- ⚠️ Note: Where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. MergeQueue is NOT enabled in this repository. If you have write access to the repo, the PR has 1-2 approvals (see above), and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #apm-dotnet channel in Slack. -->
1 parent cf02335 commit 58b4e14

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build/cmake/FindRe2.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ if (ISMACOS)
88
SET (OSXRE2BUILDCOMMAND
99
echo "Building Re2 Arm64" &&
1010
rm -f -r ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/obj &&
11-
${CMAKE_COMMAND} -E env LDFLAGS=-arch\ arm64 ARFLAGS=-r\ -s\ -c CXXFLAGS=-O3\ -g\ -fPIC\ -target\ arm64-apple-darwin${CMAKE_HOST_SYSTEM_VERSION}\ -Wno-unused-but-set-variable\ -D_GLIBCXX_USE_CXX11_ABI=0 $(MAKE) -j &&
11+
${CMAKE_COMMAND} -E env MAKEFLAGS=-s LDFLAGS=-arch\ arm64 ARFLAGS=-r\ -s\ -c CXXFLAGS=-O3\ -g\ -fPIC\ -target\ arm64-apple-darwin${CMAKE_HOST_SYSTEM_VERSION}\ -Wno-unused-but-set-variable\ -D_GLIBCXX_USE_CXX11_ABI=0 $(MAKE) -j &&
1212
mv ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/obj/libre2.a ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/libre2.arm64.a &&
1313
echo "Building Re2 X86_64" &&
1414
rm -f -r ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/obj &&
15-
${CMAKE_COMMAND} -E env LDFLAGS=-arch\ x86_64 ARFLAGS=-r\ -s\ -c CXXFLAGS=-O3\ -g\ -fPIC\ -target\ x86_64-apple-darwin${CMAKE_HOST_SYSTEM_VERSION}\ -Wno-unused-but-set-variable\ -D_GLIBCXX_USE_CXX11_ABI=0 $(MAKE) -j &&
15+
${CMAKE_COMMAND} -E env MAKEFLAGS=-s LDFLAGS=-arch\ x86_64 ARFLAGS=-r\ -s\ -c CXXFLAGS=-O3\ -g\ -fPIC\ -target\ x86_64-apple-darwin${CMAKE_HOST_SYSTEM_VERSION}\ -Wno-unused-but-set-variable\ -D_GLIBCXX_USE_CXX11_ABI=0 $(MAKE) -j &&
1616
mv ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/obj/libre2.a ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/libre2.x86_64.a &&
1717
echo "Creating Re2 universal binary" &&
1818
lipo ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/libre2.arm64.a ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/libre2.x86_64.a -create -output ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/obj/libre2.a
@@ -27,6 +27,9 @@ if (ISMACOS)
2727
BUILD_COMMAND ${OSXRE2BUILDCOMMAND}
2828
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/re2-prefix/src/re2/obj/libre2.a
2929
)
30+
31+
set_property(TARGET re2 PROPERTY JOB_SERVER_AWARE TRUE)
32+
3033
elseif(ISLINUX)
3134
ExternalProject_Add(re2
3235
DOWNLOAD_COMMAND ${DOWNLOAD_COMMAND}

0 commit comments

Comments
 (0)