Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个项目组,其中包含三个项目(两个 exe 和一个 dll)。现在,在两个 exe 项目共享的一个单元中,我只想在特定项目中编译特定区域。我怎样才能做到这一点?我应该做这样的事情吗?
{$IF PROJECT1} // Compile this code {$IFEND}
我以前从未使用过 Delphi 编译器指令。
编译器指令是在项目级别定义的(项目 > 选项 > Delphi 编译器 > 编译),所以只要你定义了指令,它就应该像你描述的那样工作。