Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/actions/cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ inputs:
description: Whether to enable compiler trace reports
required: true
default: "false"
use_mold:
description: Whether to use mold linker
required: true
default: "false"
package:
description: Whether to generate Debian package
required: true
Expand All @@ -59,7 +55,6 @@ runs:
COVERAGE: "${{ inputs.code_coverage == 'true' && 'ON' || 'OFF' }}"
STATIC: "${{ inputs.static == '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' }}"
run: |
cmake \
Expand All @@ -74,5 +69,4 @@ runs:
-Dcoverage="${COVERAGE}" \
-Dstatic="${STATIC}" \
-Dtime_trace="${TIME_TRACE}" \
-Duse_mold="${USE_MOLD}" \
-Dpackage="${PACKAGE}"
1 change: 0 additions & 1 deletion .github/workflows/build_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ jobs:
code_coverage: ${{ inputs.code_coverage }}
static: ${{ inputs.static }}
time_trace: ${{ inputs.analyze_build_time }}
use_mold: ${{ runner.os != 'macOS' }}
package: ${{ inputs.package }}

- name: Build Clio
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ option(lint "Run clang-tidy checks during compilation" FALSE)
option(static "Statically linked Clio" FALSE)
option(snapshot "Build snapshot tool" 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")
Expand Down
17 changes: 10 additions & 7 deletions cmake/Linker.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
if (use_mold)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Using Mold linker")
set(CMAKE_LINKER_TYPE MOLD)
else ()
message(FATAL_ERROR "Mold linker is only supported on Linux.")
endif ()
if (DEFINED CMAKE_LINKER_TYPE)
message(STATUS "Custom linker is already set: ${CMAKE_LINKER_TYPE}")
return()
endif ()

find_program(MOLD_PATH mold)

if (MOLD_PATH AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Using Mold linker: ${MOLD_PATH}")
set(CMAKE_LINKER_TYPE MOLD)
endif ()
Loading