Adding CFLAGS="-std=gnu90" to CMakeLists.txt creates error that the file "-std=gnu90" is not found

115 views Asked by At

I am trying to build a project that includes UCL, and from what I have been able to figure out the error here can be resolved by setting std=gnu90 for the UCL project.

However, adding the flag for the C version causes an error stating that the file is not found. What needs to be fixed?

configure:2091: gcc "-std=gnu90"   conftest.c  >&5
gcc: error: "-std=gnu90": No such file or directory
checking whether your compiler passes the ACC conformance test... FAILED
configure: 
configure: Your compiler failed the ACC conformance test - for details see 
configure: `config.log'. Please check that log file and consider sending
configure: a patch or bug-report to <[email protected]>.
configure: Thanks for your support.
configure: 
configure: error: ACC conformance test failed. Stop.

I tried to add set(UCL_CFLAGS "-std=GNU90") to the block that deals with this project, but looking in the config.log I see that the UCL_CFLAGS varible is still empty.

set(UCL_VERSION 1.03)
set(UCL_URL "${THIRD_PARTY_DIRECTORY}/ucl-${UCL_VERSION}.tar.gz" CACHE STRING "URL to the UCL")
set(UCL_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/UCL)
set(UCL_PREFIX_DIR  ${UCL_INSTALL_DIR})

ExternalProject_Add(ucl
  URL               ${UCL_URL}
  PREFIX            ${UCL_PREFIX_DIR}
  CONFIGURE_COMMAND CFLAGS="-std=gnu90" ${UCL_PREFIX_DIR}/src/ucl/configure --prefix=${UCL_INSTALL_DIR} --with-pic  BUILD_IN_SOURCE   1
  BUILD_IN_SOURCE   1
  UPDATE_COMMAND    ""
  BUILD_ALWAYS      0
)
include_directories("${UCL_INSTALL_DIR}/include")

I used this as a reference : https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/ucl

The Cmakelist and the project is located here : https://github.com/quarkslab/legu_unpacker_2019/blob/master/pylegu/CMakeLists.txt

0

There are 0 answers