diff options
Diffstat (limited to 'tools/cpp/CROSSTOOL.tpl')
-rw-r--r-- | tools/cpp/CROSSTOOL.tpl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/cpp/CROSSTOOL.tpl b/tools/cpp/CROSSTOOL.tpl index f4f0f36834..64234625d9 100644 --- a/tools/cpp/CROSSTOOL.tpl +++ b/tools/cpp/CROSSTOOL.tpl @@ -713,6 +713,50 @@ toolchain { } feature { + name: 'link_crt_library' + flag_set { + action: 'c-compile' + action: 'c++-compile' + flag_group { + # The flag is filled by cc_configure. + # The default option is /MT, set USE_DYNAMIC_CRT=1 to change it to /MD + flag: "%{crt_option}" + } + } + flag_set { + action: 'c++-link-executable' + action: 'c++-link-dynamic-library' + flag_group { + # The flag is filled by cc_configure. + # The default value is libcmt.lib, set USE_DYNAMIC_CRT=1 to change it to msvcrt.lib + flag: "/DEFAULTLIB:%{crt_library}" + } + } + } + + feature { + name: 'link_crt_debug_library' + flag_set { + action: 'c-compile' + action: 'c++-compile' + flag_group { + # The flag is filled by cc_configure. + # The default option is /MTd, set USE_DYNAMIC_CRT=1 to change it to /MDd + flag: "%{crt_debug_option}" + } + } + flag_set { + action: 'c++-link-executable' + action: 'c++-link-dynamic-library' + flag_group { + # The flag is filled by cc_configure. + # The default value is libcmtd.lib, set USE_DYNAMIC_CRT=1 to change it to msvcrtd.lib + flag: "/DEFAULTLIB:%{crt_debug_library}" + } + } + } + + feature { name: 'dbg' flag_set { action: 'c-compile' @@ -734,6 +778,7 @@ toolchain { flag: "/INCREMENTAL:NO" } } + implies: 'link_crt_debug_library' implies: 'generate_pdb_file' } @@ -755,6 +800,7 @@ toolchain { flag: "/INCREMENTAL:NO" } } + implies: 'link_crt_library' implies: 'generate_pdb_file' } @@ -767,6 +813,7 @@ toolchain { flag: "/O2" } } + implies: 'link_crt_library' } compilation_mode_flags { |