Windows XP Pro 32bit
Visual studio 2008 VC Express edition.
I have installed cmake and created the CMakeLists.txt and I want to cross-platform for Linux/windows.
Everything works ok for running on linux. So I copied my source directory as I am doing out of source building to my windows xp machine.
I used the cmake-GUI to configure/generate the solution files. Everything ok there.
However, when I opened the solution file and selected build from menu I got the following error.
cl : Command line error D8021 : invalid numeric argument '/Wextra'
Not sure really where to start looking to solve this error. If any one can point me in the right direction.
Many thanks for any suggestions,
Your CMakeLists.txt defines compile flag -Wextra for GCC and then CMake tried to use that on cl (the Microsoft compiler) too. Fix the CMakeLists.txt so that it tests for compiler before setting warning flags, i.e.
# Set default compile flags for GCC
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -pedantic -Wall -Wextra")
endif(CMAKE_COMPILER_IS_GNUCXX)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With