Skip to content

Commit ae6a083

Browse files
committed
build: repair linker detection with CMake
Add a workaround to repair the linker detection in CMake to allow testing properly in GHA based CI.
1 parent f2a841e commit ae6a083

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ See https://swift.org/LICENSE.txt for license information
99

1010
cmake_minimum_required(VERSION 3.24)
1111

12+
# FIXME: The C language is enabled as `GNUInstallDirs` requires the language to
13+
# function properly. We must further enable the language in the initial set to
14+
# ensure that the correct linker is detected.
1215
project(SwiftDocC
13-
LANGUAGES Swift)
16+
LANGUAGES C Swift)
1417

1518
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
1619
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -20,7 +23,6 @@ set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
2023
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
2124
set(CMAKE_Swift_LANGUAGE_VERSION 5)
2225

23-
enable_language(C)
2426
include(GNUInstallDirs)
2527

2628
# NOTE(compnerd) workaround CMake issues

0 commit comments

Comments
 (0)