File tree Expand file tree Collapse file tree 3 files changed +130
-71
lines changed Expand file tree Collapse file tree 3 files changed +130
-71
lines changed Original file line number Diff line number Diff line change @@ -62,16 +62,20 @@ if exist "%root_dir%.cache\cpp2\source\_build\cpp2b.ixx" (
62
62
63
63
setlocal enableextensions disabledelayedexpansion
64
64
65
- set " search = @CPP2B_PROJECT_ROOT@"
66
- set " replace = %root_dir% "
67
65
68
66
set " inputFile = %root_dir% share\cpp2b.cppm.tpl"
69
67
set " outputFile = %root_dir% .cache\cpp2\source\_build\cpp2b.ixx"
70
68
69
+ set " compiler_subst = @CPP2B_COMPILER@"
70
+ set " compiler_value = msvc"
71
+ set " project_root_subst = @CPP2B_PROJECT_ROOT@"
72
+ set " project_root_value = %root_dir% "
71
73
for /f " delims=" %%i in ('type " %inputFile% " ') do (
72
74
set " line = %%i "
73
75
setlocal enabledelayedexpansion
74
- >> " %outputFile% " echo(!line:%search% =%replace% !
76
+ call set " line = !line:%compiler_subst% =%compiler_value% ! "
77
+ call set " line = !line:%project_root_subst% =%project_root_value% ! "
78
+ >> " %outputFile% " echo(!line!
75
79
endlocal
76
80
)
77
81
endlocal
Original file line number Diff line number Diff line change @@ -41,15 +41,7 @@ constexpr auto target_platform() -> platform {
41
41
}
42
42
43
43
constexpr auto compiler() -> compiler_type {
44
- #if defined(_MSC_VER)
45
- return compiler_type::msvc;
46
- #elif defined(__clang__)
47
- return compiler_type::clang;
48
- #elif defined(__GNUC__)
49
- return compiler_type::gcc;
50
- #else
51
- # error unknown compiler
52
- #endif
44
+ return compiler_type::@CPP2B_COMPILER@;
53
45
}
54
46
55
47
constexpr auto build() -> build_type {
You can’t perform that action at this time.
0 commit comments