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" (
6262
6363setlocal enableextensions disabledelayedexpansion
6464
65- set " search = @CPP2B_PROJECT_ROOT@"
66- set " replace = %root_dir% "
6765
6866set " inputFile = %root_dir% share\cpp2b.cppm.tpl"
6967set " outputFile = %root_dir% .cache\cpp2\source\_build\cpp2b.ixx"
7068
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% "
7173for /f " delims=" %%i in ('type " %inputFile% " ') do (
7274 set " line = %%i "
7375 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!
7579 endlocal
7680)
7781endlocal
Original file line number Diff line number Diff line change @@ -41,15 +41,7 @@ constexpr auto target_platform() -> platform {
4141}
4242
4343constexpr 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@;
5345}
5446
5547constexpr auto build() -> build_type {
You can’t perform that action at this time.
0 commit comments