File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,6 @@ inputs:
3333 description : Whether to enable compiler trace reports
3434 required : true
3535 default : " false"
36- use_mold :
37- description : Whether to use mold linker
38- required : true
39- default : " false"
4036 package :
4137 description : Whether to generate Debian package
4238 required : true
5955 COVERAGE : " ${{ inputs.code_coverage == 'true' && 'ON' || 'OFF' }}"
6056 STATIC : " ${{ inputs.static == 'true' && 'ON' || 'OFF' }}"
6157 TIME_TRACE : " ${{ inputs.time_trace == 'true' && 'ON' || 'OFF' }}"
62- USE_MOLD : " ${{ inputs.use_mold == 'true' && 'ON' || 'OFF' }}"
6358 PACKAGE : " ${{ inputs.package == 'true' && 'ON' || 'OFF' }}"
6459 run : |
6560 cmake \
7469 -Dcoverage="${COVERAGE}" \
7570 -Dstatic="${STATIC}" \
7671 -Dtime_trace="${TIME_TRACE}" \
77- -Duse_mold="${USE_MOLD}" \
7872 -Dpackage="${PACKAGE}"
Original file line number Diff line number Diff line change @@ -121,7 +121,6 @@ jobs:
121121 code_coverage : ${{ inputs.code_coverage }}
122122 static : ${{ inputs.static }}
123123 time_trace : ${{ inputs.analyze_build_time }}
124- use_mold : ${{ runner.os != 'macOS' }}
125124 package : ${{ inputs.package }}
126125
127126 - name : Build Clio
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ option(lint "Run clang-tidy checks during compilation" FALSE)
1616option (static "Statically linked Clio" FALSE )
1717option (snapshot "Build snapshot tool" FALSE )
1818option (time_trace "Build using -ftime-trace to create compiler trace reports" FALSE )
19- option (use_mold "Use mold linker" FALSE )
2019
2120# ========================================================================== #
2221set (san "" CACHE STRING "Add sanitizer instrumentation" )
Original file line number Diff line number Diff line change 1- if (use_mold)
2- if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
3- message (STATUS "Using Mold linker" )
4- set (CMAKE_LINKER_TYPE MOLD)
5- else ()
6- message (FATAL_ERROR "Mold linker is only supported on Linux." )
7- endif ()
1+ if (DEFINED CMAKE_LINKER_TYPE)
2+ message (STATUS "Custom linker is already set: ${CMAKE_LINKER_TYPE} " )
3+ return ()
4+ endif ()
5+
6+ find_program (MOLD_PATH mold)
7+
8+ if (MOLD_PATH AND CMAKE_SYSTEM_NAME STREQUAL "Linux" )
9+ message (STATUS "Using Mold linker: ${MOLD_PATH} " )
10+ set (CMAKE_LINKER_TYPE MOLD)
811endif ()
You can’t perform that action at this time.
0 commit comments