Angelo
Angelo

Reputation: 173

How do I enable the SSE/SSE2 instruction set in Visual Studio 2008 (using CMake)?

In Visual Studio 2005 I went in:

View --> Property Pages --> C/C++ --> Code Generation --> Enable Enhanced Instruction Set

But in Visual Studio 2008?

Thanks in advance

Upvotes: 16

Views: 36204

Answers (4)

Andre
Andre

Reputation:

If you are using inline assembler __asm { .... } you don't need to enable it.

But if you enable SSE you have to be careful. It may be that the code is slower than normal FPU code.

Upvotes: 0

larsmoa
larsmoa

Reputation: 12942

Using CMake you could add the following to CMakeLists.txt:

IF(MSVC)
   ADD_DEFINITIONS(/arch:SSE)
ENDIF(MSVC)

or /arch:SSE2.

Upvotes: 14

Cat Plus Plus
Cat Plus Plus

Reputation: 129894

If you're looking for SSE/SSE2: Project > Properties > Configuration Properties > C/C++ > Code Generation > Enable Enhanced Instruction Set, or append /arch:SSE (or /arch:SSE2) in Command Line > Additional Options.

You need to have a native project, and at least one .cpp file added to access this, though.

Upvotes: 39

Naveen
Naveen

Reputation: 73473

It is Project->Properties... (same path as above)

Upvotes: 1

Related Questions