Andrey Rubshtein
Andrey Rubshtein

Reputation: 20915

Is it possible to have different .DEF files per build configuration?

I have a project that compiles into a DLL. I am using a .DEF file to manage the exported functions. For instance:

EXPORTS
    MyFoo1
    MyFoo2
    MyFoo3
    MyFoo4

Is it possible to have different .DEF files in debug and release configurations? I would like to have a larger set of functions in debug mode than in release.

For example, I would like to have in release mode only MyFoo1.

Currently I thought about using __declspec instead of .DEF file, and use some macro that will enable them only when the macro is on. The macro in turn, can be put into pre-processor definitions, which is dependent on build configuration.

Is it possible to accomplish this goal without switching from .DEF files to __declspec mechanism?

Upvotes: 0

Views: 248

Answers (1)

msam
msam

Reputation: 4287

You can set a different DEF file for every build configuration : Project properties -> Linker -> Input -> Module Definiton File

This sets the /DEF option

Upvotes: 2

Related Questions