ardabro
ardabro

Reputation: 2061

cmake: how to define target without linking (compilation only)

Is there any simple way to create a target where object files aren't linked? I need additional target only for tests if everything compiles for ARM. I don't want to create any executable (it would not link anyway), because my project will be finally a part of something much bigger, which has its own old stable make-based build system.

So I just need to compile sources. All tests are done with other, PC target compiled with gcc.

Upvotes: 7

Views: 7825

Answers (1)

Antonio
Antonio

Reputation: 20256

You can use an object library:

add_library(dummy OBJECT <source files>)

See also:

Upvotes: 17

Related Questions