Skip to content

Commit d1cb6d1

Browse files
authored
Add FIREBASE_LD_EXECUTABLE cmake cache variable (#9932)
1 parent 97b34aa commit d1cb6d1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ endif()
6060
enable_language(C)
6161
enable_language(CXX)
6262

63+
set(
64+
FIREBASE_LD_EXECUTABLE
65+
""
66+
CACHE
67+
STRING
68+
"The filename of the C/C++ linker to use. \
69+
For example, the default linker for clang and gcc is ld. \
70+
Using a fast linker, like mold (https://github.com/rui314/mold), \
71+
could be useful during development to reduce build/test cycle times."
72+
)
73+
74+
if(NOT ("${FIREBASE_LD_EXECUTABLE}" STREQUAL ""))
75+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=${FIREBASE_LD_EXECUTABLE}")
76+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=${FIREBASE_LD_EXECUTABLE}")
77+
endif()
78+
6379
option(
6480
FIREBASE_IOS_BUILD_BENCHMARKS
6581
"Enable building of C++ and Objective-C benchmarks for this project"

0 commit comments

Comments
 (0)