久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

#include 所有 .cpp 文件到一個編譯單元?

#include all .cpp files into a single compilation unit?(#include 所有 .cpp 文件到一個編譯單元?)
本文介紹了#include 所有 .cpp 文件到一個編譯單元?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我最近有理由使用通常的調(diào)試和發(fā)布配置以及我以前從未見過的全部發(fā)布"和全部調(diào)試"來處理一些 Visual Studio C++ 項目.

I recently had cause to work with some Visual Studio C++ projects with the usual Debug and Release configurations, but also 'Release All' and 'Debug All', which I had never seen before.

事實證明,項目的作者有一個 ALL.cpp,其中 #includes 所有其他 .cpp 文件.*All 配置只是構(gòu)建這個 ALL.cpp 文件.它當(dāng)然被排除在常規(guī)配置之外,常規(guī)配置不構(gòu)建ALL.cpp

It turns out the author of the projects has a single ALL.cpp which #includes all other .cpp files. The *All configurations just build this one ALL.cpp file. It is of course excluded from the regular configurations, and regular configurations don't build ALL.cpp

我只是想知道這是否是一種常見做法?它帶來什么好處?(我的第一反應(yīng)是它聞起來很糟糕.)

I just wondered if this was a common practice? What benefits does it bring? (My first reaction was that it smelled bad.)

您可能會遇到哪些陷阱?我能想到的一個問題是,如果您的 .cpps 中有匿名命名空間,它們不再是該 cpp 的私有"名稱,但現(xiàn)在在其他 cpp 中也可見?

What kinds of pitfalls are you likely to encounter with this? One I can think of is if you have anonymous namespaces in your .cpps, they're no longer 'private' to that cpp but now visible in other cpps as well?

所有項目都構(gòu)建 DLL,所以在匿名命名空間中保存數(shù)據(jù)不是一個好主意,對吧?但是功能就可以了嗎?

All the projects build DLLs, so having data in anonymous namespaces wouldn't be a good idea, right? But functions would be OK?

推薦答案

它被一些人(和 google-able)稱為Unity Build".它的鏈接速度非???,編譯速度也相當(dāng)快.它非常適合您不需要迭代的構(gòu)建,例如來自中央服務(wù)器的發(fā)布構(gòu)建,但不一定適用于增量構(gòu)建.

It's referred to by some (and google-able) as a "Unity Build". It links insanely fast and compiles reasonably quickly as well. It's great for builds you don't need to iterate on, like a release build from a central server, but it isn't necessarily for incremental building.

這是一個需要維護的 PITA.

And it's a PITA to maintain.

這是獲取更多信息的第一個谷歌鏈接:http://buffered.io/posts/the-magic-of-unity-builds/

here's the first google link for more info: http://buffered.io/posts/the-magic-of-unity-builds/

使其快速的原因是編譯器只需要讀入所有內(nèi)容,編譯出來,然后鏈接,而不是對每個 .cpp 文件都這樣做.

The thing that makes it fast is that the compiler only needs to read in everything once, compile out, then link, rather than doing that for every .cpp file.

Bruce Dawson 在他的博客上寫得更好:http://randomascii.wordpress.com/2014/03/22/make-vc-compiles-fast-through-parallel-compilation/

Bruce Dawson has a much better write up about this on his blog: http://randomascii.wordpress.com/2014/03/22/make-vc-compiles-fast-through-parallel-compilation/

這篇關(guān)于#include 所有 .cpp 文件到一個編譯單元?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How do I set the icon for my application in visual studio 2008?(如何在 Visual Studio 2008 中為我的應(yīng)用程序設(shè)置圖標(biāo)?)
Convert CString to const char*(將 CString 轉(zhuǎn)換為 const char*)
Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio(默認情況下,在 Visual Studio 中從項目中刪除安全警告 (_CRT_SECURE_NO_WARNINGS))
How do I start a new CUDA project in Visual Studio 2008?(如何在 Visual Studio 2008 中啟動新的 CUDA 項目?)
Exporting classes containing `std::` objects (vector, map etc.) from a DLL(從 DLL 導(dǎo)出包含 `std::` 對象(向量、映射等)的類)
What are some reasons a Release build would run differently than a Debug build(發(fā)布版本與調(diào)試版本的運行方式不同的一些原因是什么)
主站蜘蛛池模板: 欧美九九九 | 性做久久久久久久免费看 | 乳大翘臀1v1h糙汉 | 黄色大片在线免费观看 | 午夜视频网 | 日韩精品免费在线观看 | 97久久久| 国产肉体xxxx裸体784大胆 | 国产欧美日韩综合 | 日韩中文字幕 | 成人在线国产 | 成人三级在线观看 | 成年人毛片 | 一区二区不卡视频 | 成人一区二区三区 | 亚洲国产天堂 | 日本天堂网 | 欧美视频亚洲视频 | 亚洲天堂免费视频 | 亚洲一区二区三区在线 | 国产成人精品视频 | 一区二区三区高清 | 精品国产毛片 | 特黄一级视频 | 一区二区三区视频在线观看 | av久草| 午夜精品久久久久久久99黑人 | 成年人免费在线视频 | 精品日韩在线观看 | 男女av在线 | 触手繁殖の地狱3d啪啪 | 国产三级久久 | 国产精品久久久久久久久久久久午夜片 | 五月天视频 | 可以看毛片的网站 | 一区二区影视 | 国产一区在线播放 | 日韩一级片视频 | 在线视频一区二区三区 | 中文字幕在线观看一区二区三区 | 婷色 |