mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 11:55:51 +00:00 
			
		
		
		
	chore: Use mold when available without option (#2521)
This commit is contained in:
		
							
								
								
									
										6
									
								
								.github/actions/cmake/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/actions/cmake/action.yml
									
									
									
									
										vendored
									
									
								
							@@ -33,10 +33,6 @@ inputs:
 | 
				
			|||||||
    description: Whether to enable compiler trace reports
 | 
					    description: Whether to enable compiler trace reports
 | 
				
			||||||
    required: true
 | 
					    required: true
 | 
				
			||||||
    default: "false"
 | 
					    default: "false"
 | 
				
			||||||
  use_mold:
 | 
					 | 
				
			||||||
    description: Whether to use mold linker
 | 
					 | 
				
			||||||
    required: true
 | 
					 | 
				
			||||||
    default: "false"
 | 
					 | 
				
			||||||
  package:
 | 
					  package:
 | 
				
			||||||
    description: Whether to generate Debian package
 | 
					    description: Whether to generate Debian package
 | 
				
			||||||
    required: true
 | 
					    required: true
 | 
				
			||||||
@@ -59,7 +55,6 @@ runs:
 | 
				
			|||||||
        COVERAGE: "${{ inputs.code_coverage == 'true' && 'ON' || 'OFF' }}"
 | 
					        COVERAGE: "${{ inputs.code_coverage == 'true' && 'ON' || 'OFF' }}"
 | 
				
			||||||
        STATIC: "${{ inputs.static == 'true' && 'ON' || 'OFF' }}"
 | 
					        STATIC: "${{ inputs.static == 'true' && 'ON' || 'OFF' }}"
 | 
				
			||||||
        TIME_TRACE: "${{ inputs.time_trace == 'true' && 'ON' || 'OFF' }}"
 | 
					        TIME_TRACE: "${{ inputs.time_trace == 'true' && 'ON' || 'OFF' }}"
 | 
				
			||||||
        USE_MOLD: "${{ inputs.use_mold == 'true' && 'ON' || 'OFF' }}"
 | 
					 | 
				
			||||||
        PACKAGE: "${{ inputs.package == 'true' && 'ON' || 'OFF' }}"
 | 
					        PACKAGE: "${{ inputs.package == 'true' && 'ON' || 'OFF' }}"
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        cmake \
 | 
					        cmake \
 | 
				
			||||||
@@ -74,5 +69,4 @@ runs:
 | 
				
			|||||||
          -Dcoverage="${COVERAGE}" \
 | 
					          -Dcoverage="${COVERAGE}" \
 | 
				
			||||||
          -Dstatic="${STATIC}" \
 | 
					          -Dstatic="${STATIC}" \
 | 
				
			||||||
          -Dtime_trace="${TIME_TRACE}" \
 | 
					          -Dtime_trace="${TIME_TRACE}" \
 | 
				
			||||||
          -Duse_mold="${USE_MOLD}" \
 | 
					 | 
				
			||||||
          -Dpackage="${PACKAGE}"
 | 
					          -Dpackage="${PACKAGE}"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								.github/workflows/build_impl.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/workflows/build_impl.yml
									
									
									
									
										vendored
									
									
								
							@@ -121,7 +121,6 @@ jobs:
 | 
				
			|||||||
          code_coverage: ${{ inputs.code_coverage }}
 | 
					          code_coverage: ${{ inputs.code_coverage }}
 | 
				
			||||||
          static: ${{ inputs.static }}
 | 
					          static: ${{ inputs.static }}
 | 
				
			||||||
          time_trace: ${{ inputs.analyze_build_time }}
 | 
					          time_trace: ${{ inputs.analyze_build_time }}
 | 
				
			||||||
          use_mold: ${{ runner.os != 'macOS' }}
 | 
					 | 
				
			||||||
          package: ${{ inputs.package }}
 | 
					          package: ${{ inputs.package }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Build Clio
 | 
					      - name: Build Clio
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,6 @@ option(lint "Run clang-tidy checks during compilation" FALSE)
 | 
				
			|||||||
option(static "Statically linked Clio" FALSE)
 | 
					option(static "Statically linked Clio" FALSE)
 | 
				
			||||||
option(snapshot "Build snapshot tool" FALSE)
 | 
					option(snapshot "Build snapshot tool" FALSE)
 | 
				
			||||||
option(time_trace "Build using -ftime-trace to create compiler trace reports" FALSE)
 | 
					option(time_trace "Build using -ftime-trace to create compiler trace reports" FALSE)
 | 
				
			||||||
option(use_mold "Use mold linker" FALSE)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ========================================================================== #
 | 
					# ========================================================================== #
 | 
				
			||||||
set(san "" CACHE STRING "Add sanitizer instrumentation")
 | 
					set(san "" CACHE STRING "Add sanitizer instrumentation")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,11 @@
 | 
				
			|||||||
if (use_mold)
 | 
					if (DEFINED CMAKE_LINKER_TYPE)
 | 
				
			||||||
  if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
 | 
					  message(STATUS "Custom linker is already set: ${CMAKE_LINKER_TYPE}")
 | 
				
			||||||
    message(STATUS "Using Mold linker")
 | 
					  return()
 | 
				
			||||||
    set(CMAKE_LINKER_TYPE MOLD)
 | 
					endif ()
 | 
				
			||||||
  else ()
 | 
					
 | 
				
			||||||
    message(FATAL_ERROR "Mold linker is only supported on Linux.")
 | 
					find_program(MOLD_PATH mold)
 | 
				
			||||||
  endif ()
 | 
					
 | 
				
			||||||
 | 
					if (MOLD_PATH AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
 | 
				
			||||||
 | 
					  message(STATUS "Using Mold linker: ${MOLD_PATH}")
 | 
				
			||||||
 | 
					  set(CMAKE_LINKER_TYPE MOLD)
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user