libcaption icon indicating copy to clipboard operation
libcaption copied to clipboard

Specifies C version to enable compiling in certain Linux flavors

Open nabeards opened this issue 6 years ago • 2 comments

When compiling on CentOS 7, I need to have the C Standard specify for the build process to work properly.

I also fixed a very minor unit test warning by typecasting for the fprintf statement.

nabeards avatar Nov 01 '18 17:11 nabeards

Hi Neil,

The variable set(CMAKE_C_STANDARD 11) was introduced in CMake v3.1. In order to support older platforms (like mine with no C11), you may want to consider something like this:

if (CMAKE_VERSION VERSION_EQUAL "3.1" OR CMAKE_VERSION VERSION_EQUAL "3.1")
    set(CMAKE_C_STANDARD 11)

embeddedguy1138 avatar Nov 01 '18 18:11 embeddedguy1138

Excellent point, I've updated the branch. (Assumed you meant the second test to be VERSION_GREATER.)

nabeards avatar Nov 01 '18 19:11 nabeards