File tree 5 files changed +24
-10
lines changed 5 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 36
36
-DLLVM_ROOT_DIR="$PWD/../${{ inputs.llvm_dir }}" \
37
37
-DD_COMPILER='${{ inputs.host_dc }}' \
38
38
-DLDC_LINK_MANUALLY=OFF \
39
- ${{ runner.os == 'macOS' && '-DCMAKE_C_COMPILER=/usr/bin/cc' || '' }} \
40
- ${{ runner.os == 'macOS' && '-DCMAKE_CXX_COMPILER=/usr/bin/c++' || '' }} \
41
39
${{ inputs.specify_install_dir == 'true' && '-DCMAKE_INSTALL_PREFIX="$installDir"' || '' }} \
42
40
${{ inputs.specify_install_dir == 'true' && '-DINCLUDE_INSTALL_DIR="$installDir/import"' || '' }} \
43
41
${{ inputs.cmake_flags }}
Original file line number Diff line number Diff line change @@ -28,17 +28,17 @@ jobs:
28
28
os : macos-14
29
29
host_dc : ldc-beta
30
30
llvm_version : 17.0.5
31
- cmake_flags : -DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON -DCMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/opt/zstd/lib -DCMAKE_C_COMPILER=/usr/bin/cc -DCMAKE_CXX_COMPILER=/usr/bin/c++
31
+ cmake_flags : -DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON -DCMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/opt/zstd/lib
32
32
- job_name : macOS 14, LLVM 16, latest LDC beta
33
33
os : macos-14
34
34
host_dc : ldc-beta
35
35
llvm_version : 16.0.5
36
- cmake_flags : -DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/opt/zstd/lib -DCMAKE_C_COMPILER=/usr/bin/cc -DCMAKE_CXX_COMPILER=/usr/bin/c++
36
+ cmake_flags : -DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/opt/zstd/lib
37
37
- job_name : Ubuntu 24.04, LLVM 15, latest DMD beta
38
38
os : ubuntu-24.04
39
39
host_dc : dmd-beta
40
40
llvm_version : 15
41
- cmake_flags : -DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON -DLIB_SUFFIX=64 -DLDC_LINK_MANUALLY=ON
41
+ cmake_flags : -DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON -DLIB_SUFFIX=64
42
42
name : ${{ matrix.job_name }}
43
43
runs-on : ${{ matrix.os }}
44
44
env :
@@ -124,7 +124,6 @@ jobs:
124
124
cmake -G Ninja . \
125
125
-DCMAKE_BUILD_TYPE=Release \
126
126
-DLLVM_ROOT_DIR=${{ runner.os == 'Linux' && format('/usr/lib/llvm-{0}', matrix.llvm_version) || '"$PWD/llvm"' }} \
127
- -DLDC_LINK_MANUALLY=OFF \
128
127
${{ matrix.cmake_flags }}
129
128
ninja obj/ldc2.o all ldc2-unittest all-test-runners
130
129
bin/ldc2 --version
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.16.0)
2
2
if (POLICY CMP0025)
3
3
cmake_policy (SET CMP0025 NEW)
4
4
endif ()
5
+ if (POLICY CMP0132)
6
+ # see https://github.com/ldc-developers/ldc/issues/3901
7
+ cmake_policy (SET CMP0132 NEW)
8
+ endif ()
5
9
if (${CMAKE_VERSION} VERSION_GREATER "3.26.9" )
6
10
# Prevent implicit dependencies for custom commands, e.g.,
7
11
# `obj/ldc2.o` depending on `lib/libldc.a` with LDC_LINK_MANUALLY=ON.
Original file line number Diff line number Diff line change @@ -100,7 +100,12 @@ function(build_d_executable target_name output_exe d_src_files compiler_args lin
100
100
101
101
# We need to link against the C++ runtime library.
102
102
if (NOT MSVC AND "${D_COMPILER_ID} " STREQUAL "LDMD" AND NOT "${dflags} " MATCHES "(^|;)-gcc=" )
103
- set (translated_linker_args "-gcc=${CMAKE_CXX_COMPILER} " ${translated_linker_args} )
103
+ if (CMAKE_VERSION VERSION_LESS "4.0.0" AND APPLE AND "${CMAKE_CXX_COMPILER} " MATCHES "/Developer/.+/usr/bin/c\\ +\\ +$" )
104
+ # see https://github.com/ldc-developers/ldc/issues/3901
105
+ set (translated_linker_args "-gcc=/usr/bin/c++" ${translated_linker_args} )
106
+ else ()
107
+ set (translated_linker_args "-gcc=${CMAKE_CXX_COMPILER} " ${translated_linker_args} )
108
+ endif ()
104
109
endif ()
105
110
106
111
# Use an extra custom target as dependency for the executable in
Original file line number Diff line number Diff line change @@ -57,10 +57,19 @@ else()
57
57
list (REMOVE_ITEM testnames uuid)
58
58
endif ()
59
59
60
+ set (musl "" )
60
61
if (TARGET_SYSTEM MATCHES "musl" )
61
62
set (musl "IS_MUSL=1" )
62
63
endif ()
63
64
65
+ set (cc "CC=${CMAKE_C_COMPILER} " )
66
+ set (cxx "CXX=${CMAKE_CXX_COMPILER} " )
67
+ if (CMAKE_VERSION VERSION_LESS "4.0.0" AND CMAKE_HOST_APPLE AND "${TARGET_SYSTEM} " MATCHES "APPLE" )
68
+ # see https://github.com/ldc-developers/ldc/issues/3901
69
+ set (cc "" )
70
+ set (cxx "" )
71
+ endif ()
72
+
64
73
foreach (name ${testnames} )
65
74
foreach (build debug release)
66
75
set (druntime_path_build ${druntime_path} )
@@ -78,10 +87,9 @@ foreach(name ${testnames})
78
87
add_test (NAME ${fullname}
79
88
COMMAND ${GNU_MAKE_BIN} -C ${PROJECT_SOURCE_DIR} /druntime/test /${name}
80
89
ROOT=${outdir} DMD=${LDMD_EXE_FULL} BUILD =${build} SHARED=1
81
- CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
82
90
DRUNTIME=${druntime_path_build} DRUNTIMESO=${shared_druntime_path_build}
83
- CFLAGS_BASE=${cflags_base} DFLAGS_BASE=${dflags_base} ${linkdl}
84
- IN_LDC=1 ${musl}
91
+ ${cc} ${cxx} CFLAGS_BASE=${cflags_base} DFLAGS_BASE=${dflags_base} ${linkdl}
92
+ IN_LDC=1 ${musl}
85
93
)
86
94
set_tests_properties (${fullname} PROPERTIES DEPENDS clean-${fullname} )
87
95
endforeach ()
You can’t perform that action at this time.
0 commit comments