samedi 27 juin 2015

CMake Remove /arch:sse2 for Visual Studio 2013

The project I'm working on right now uses CMake to generate an x64 visual studio 2010 project. Currently I'm in the process of converting it to x64 visual studio 2013.

Most everything has just fallen into place correctly, however I'm getting the following warning:

cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'

Tracking this issue down, it looks like visual studio 2013 no longer supports /arch:SSE2 for x64 projects, as it is the default to use this extension.

I've searched through our various CMakeLists.txt's (we've got on in each project, and one for the solution as a whole), and we're not setting the flag, so I'd assume that this is set by default in CMake.

In visual studio I can go to project > properties > C/C++ > Code Generation > Enable Enhanced Instruction Set and set it to 'Not Set', and everything works without any warnings.

How can I do this from within the CMakeLists.txt?

I've seen several ways of setting variables, usually something along the lines of set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2"), but this can't be used to remove a flag (at least not that I'm aware of).

Aucun commentaire:

Enregistrer un commentaire