Skip to content

Commit fc723e7

Browse files
committed
Add 'Link' step to the Linux pipeline.
* Additionally fixed clang detection.
1 parent b11cf78 commit fc723e7

File tree

9 files changed

+56
-43
lines changed

9 files changed

+56
-43
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
sudo apt install libc++-12-dev libc++abi-12-dev --fix-missing
2323
- name: Create (lua-5.1.5, clang-12)
2424
run: |
25-
~/.local/bin/conan create . ice-build-tools/0.6.0@iceshard/stable --profile clang-12.0-linux-x86_64 --build=missing
25+
~/.local/bin/conan create . ice-build-tools/0.7.0@iceshard/stable --profile clang-12.0-linux-x86_64 --build=missing
2626
- name: Deploy
2727
run: |
2828
~/.local/bin/conan user iceshard -r conan-iceshard -p ${{ secrets.CONAN_PASSWORD }}
29-
~/.local/bin/conan upload -r conan-iceshard ice-build-tools/0.6.0@iceshard/stable --all
29+
~/.local/bin/conan upload -r conan-iceshard ice-build-tools/0.7.0@iceshard/stable --all

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
sudo apt install libc++-12-dev libc++abi-12-dev --fix-missing
2222
- name: Create (lua-5.1.5, clang-12)
2323
run: |
24-
~/.local/bin/conan create . ice-build-tools/0.6.0@iceshard/stable --profile clang-12.0-linux-x86_64 --build=missing
24+
~/.local/bin/conan create . ice-build-tools/0.7.0@iceshard/stable --profile clang-12.0-linux-x86_64 --build=missing
2525
- name: Success
2626
run: |
2727
echo Validation successful

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class IceBuildToolsConan(ConanFile):
66
name = "ice-build-tools"
7-
version = "0.6.0"
7+
version = "0.7.0"
88
license = "MIT"
99
description = "IceShard - build tools base"
1010
url = "https://github.com/iceshard-engine/ice-build-tools"

scripts/fastbuild/base_pipelines.bff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494

9595
.PipelineTasks = {
9696
.Task_BuildSources
97-
// .Task_LinkExecutable // Still heavy WIP
97+
.Task_LinkExecutable
9898
}
9999
]
100100

source/ice/generators/fastbuild.moon

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ class FastBuildGenerator
5555
@\line_raw "#include \"#{path}\""
5656

5757
line: (value) =>
58-
@file\write "#{@indent}#{value or ''}\n"
58+
if value
59+
@file\write "#{@indent}#{value or ''}\n"
60+
else
61+
@file\write '\n'
62+
5963

6064
line_raw: (value) =>
6165
@file\write "#{value or ''}\n"

source/ice/toolchain/clang.moon

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Where, Exec from require "ice.tools.exec"
22

33
toolchain_definitions = {
4-
'9.0.0': {
4+
'9': {
55
name: 'clang-9.0.0'
66
struct_name: 'Toolchain_Clang_x64_900'
77
compiler_name: 'compiler-clang-x64-900'
@@ -31,7 +31,7 @@ toolchain_definitions = {
3131
{ 'ToolchainLibs', { } }
3232
}
3333
}
34-
'10.0.0': {
34+
'10': {
3535
name: 'clang-10.0.0'
3636
struct_name: 'Toolchain_Clang_x64_1000'
3737
compiler_name: 'compiler-clang-x64-1000'
@@ -61,7 +61,7 @@ toolchain_definitions = {
6161
{ 'ToolchainLibs', { } }
6262
}
6363
}
64-
'11.0.0': {
64+
'11': {
6565
name: 'clang-11.0.0'
6666
struct_name: 'Toolchain_Clang_x64_1100'
6767
compiler_name: 'compiler-clang-x64-1100'
@@ -91,7 +91,7 @@ toolchain_definitions = {
9191
{ 'ToolchainLibs', { } }
9292
}
9393
}
94-
'12.0.0': {
94+
'12': {
9595
name: 'clang-12.0.0'
9696
struct_name: 'Toolchain_Clang_x64_1200'
9797
compiler_name: 'compiler-clang-x64-1200'
@@ -123,39 +123,39 @@ toolchain_definitions = {
123123
}
124124
}
125125

126-
detect_compilers = (ver_major) ->
127-
binaries = {
128-
'9': {
129-
clang_path: Where\path 'clang++-9'
130-
ar_path: Where\path 'ar'
131-
},
132-
'10': {
133-
clang_path: Where\path 'clang++-10'
134-
ar_path: Where\path 'ar'
135-
},
136-
'11': {
137-
clang_path: Where\path 'clang++-11'
138-
ar_path: Where\path 'ar'
139-
},
140-
'12': {
141-
clang_path: Where\path 'clang++-12'
142-
ar_path: Where\path 'ar'
143-
}
144-
}
145-
return binaries[tostring ver_major] or { }
126+
detect_compilers = (ver_major , log_file) ->
127+
versions = { '9', '10', '11', '12', '13' }
128+
results = { }
129+
130+
ar_path = Where\path 'ar', log_file
131+
unless os.isfile ar_path
132+
return { }
133+
134+
for ver in *versions
135+
clang_path = Where\path "clang++#{ver}", log_file
136+
if clang_path
137+
results[ver] = {
138+
:clang_path
139+
:ar_path
140+
}
141+
142+
return results[ver_major] or { }
146143

147144
class Clang
148-
@detect: (conan_profile) =>
145+
@detect: (conan_profile, log_file) =>
149146
toolchain_list = { }
150147

151148
if conan_profile and conan_profile.compiler and conan_profile.compiler.version
152149
ver_major = conan_profile.compiler.version
153150

154-
compiler = detect_compilers ver_major
151+
compiler = detect_compilers ver_major, log_file
155152
if compiler.clang_path and compiler.ar_path
156153

157154
clang_exe = compiler.clang_path
158-
clang_ver = (((Exec clang_exe)\lines '--version')[1]\gmatch "version (%d+.%d+.%d+)")!
155+
clang_ver = (((Exec clang_exe)\lines '--version')[1]\gmatch "version (%d+).(%d+).(%d+)")!
156+
157+
unless clang_ver == ver_major
158+
return
159159

160160
if toolchain_definition = toolchain_definitions[clang_ver]
161161
table.insert toolchain_list, {

source/ice/toolchain/gcc.moon

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,29 @@ toolchain_definitions = {
3333
}
3434
}
3535

36-
detect_compilers = (ver_major) ->
36+
detect_compilers = (ver_major, log_file) ->
3737
{
38-
gcc_path: Where\path 'g++'
39-
ar_path: Where\path 'ar'
38+
gcc_path: Where\path 'g++', log_file
39+
ar_path: Where\path 'ar', log_file
4040
}
4141

4242
class Gcc
43-
@detect: (conan_profile) =>
43+
@detect: (conan_profile, log_file) =>
4444
toolchain_list = { }
4545

4646
if conan_profile and conan_profile.compiler and conan_profile.compiler.version
4747
ver_major = conan_profile.compiler.version
4848

49-
50-
compiler = detect_compilers ver_major
49+
compiler = detect_compilers ver_major, log_file
5150
if compiler.gcc_path and compiler.ar_path
5251

5352
gcc_exe = compiler.gcc_path
5453
gcc_ver_lines = ((Exec gcc_exe)\lines '--version')
5554
gcc_major, gcc_minor, gcc_patch = (gcc_ver_lines[1]\gmatch "(%d+).(%d+).(%d+)")!
5655

56+
unless gcc_major == ver_major
57+
return
58+
5759
if toolchain_definition = toolchain_definitions[gcc_major]
5860
table.insert toolchain_list, {
5961
name: toolchain_definition.name

source/ice/tools/exec.moon

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ class Exec
2626

2727
class Where extends Exec
2828
@exec = os.iswindows and 'where.exe' or 'which'
29-
@path: (name) => (Where!\lines name)[1] or name
29+
@path: (name, err_log) =>
30+
args = name
31+
args ..= " 2>>#{err_log}" if err_log
32+
33+
(Where!\lines args)[1]
3034

3135
new: => @exec = @@exec
3236

source/ice/workspace/project.moon

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ install_conan_dependencies = (profile, force_update) ->
115115
build_policy:'missing'
116116

117117
generate_fastbuild_variables_script = (profile, locators, output_dir, force_update) ->
118+
log_file = 'build/compiler_detection.log'
119+
120+
os.remove log_file
118121

119122
execute_locators = (locator_type, detected_info) ->
120123
for locator in *locators[locator_type]
@@ -137,11 +140,11 @@ generate_fastbuild_variables_script = (profile, locators, output_dir, force_upda
137140
table.insert detected_info.toolchains, toolchain for toolchain in *clang_toolchains or { }
138141

139142
if os.isunix
140-
-- #TODO (#6): https://github.com/iceshard-engine/ice-build-tools/issues/6
141-
-- clang_toolchains = Clang\detect profile
142-
clang_toolchains = Gcc\detect profile
143+
clang_toolchains = Clang\detect profile, log_file
144+
gcc_toolchains = Gcc\detect profile, log_file
143145

144146
table.insert detected_info.toolchains, toolchain for toolchain in *clang_toolchains or { }
147+
table.insert detected_info.toolchains, toolchain for toolchain in *gcc_toolchains or { }
145148

146149

147150
-- execute_locators Locator.Type.Toolchain, toolchains -- Currently unused

0 commit comments

Comments
 (0)