Stiffstream / restinio-conan-example

An example of RESTinio usage via Conan
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

cmake build fails on ubuntu:16.04 #2

Closed binarytrails closed 4 years ago

binarytrails commented 5 years ago

I tried your conan example with docker and it builds on ubuntu:18.10. However, the thing is that most of the people are using the ubuntu:16.04 version which is a long term release until 2024.

Doing a FROM ubuntu:16.04 produces this error:

restinio/0.5.0@stiffstream/stable: Calling package()
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:13 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "CXX_STANDARD" is not allowed.

CMake Error at CMakeLists.txt:13 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "CXX_STANDARD_REQUIRED" is not allowed.

CMake Error at CMakeLists.txt:13 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "CXX_EXTENSIONS" is not allowed.

-- Configuring incomplete, errors occurred!
See also "/root/.conan/data/restinio/0.5.0/stiffstream/stable/build/59a75abe1e2177827af55dbe042f25f79ce4c019/CMakeFiles/CMakeOutput.log".
asio/1.12.2@bincrafters/stable: WARN: This conanfile has no build step
restinio/0.5.0@stiffstream/stable: WARN: This conanfile has no build step
ERROR: restinio/0.5.0@stiffstream/stable: Error in package() method, line 52
    cmake = self._configure_cmake()
while calling '_configure_cmake', line 48
    cmake.configure(source_folder = self.source_subfolder + "/dev/restinio")
    ConanException: Error 256 while executing cd '/root/.conan/data/restinio/0.5.0/stiffstream/stable/build/59a75abe1e2177827af55dbe042f25f79ce4c019' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="5" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++" -DCMAKE_INSTALL_PREFIX="/root/.conan/data/restinio/0.5.0/stiffstream/stable/package/59a75abe1e2177827af55dbe042f25f79ce4c019" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DRESTINIO_INSTALL="True" -DRESTINIO_FIND_DEPS="False" -DRESTINIO_USE_BOOST_ASIO="none" -Wno-dev '/root/.conan/data/restinio/0.5.0/stiffstream/stable/build/59a75abe1e2177827af55dbe042f25f79ce4c019/restinio/dev/restinio'
The command '/bin/sh -c echo "*** Building RESTinio ***"    && cd restinio-conan    && mkdir build  && cd build     && conan install -o restinio:boost_libs=none --build=missing ..     && cmake ..     && cmake --build . --config Release     && cd ../ && rm -rf restinio-conan/' returned a non-zero code: 1
binarytrails commented 5 years ago

I found a fix with RUN pip3 install --upgrade cmake as explained here the CXX_STANDARD, CXX_STANDARD_REQUIRED, CXX_EXTENSIONS comes with cmake 3.8. I can make a PR if you want.

binarytrails commented 4 years ago

this is fixed here https://github.com/Stiffstream/restinio/commit/eab82ab3d049355028e11446b48d195c081717be which means that updating cmake is not necessary now in your docker in this repo here: https://github.com/Stiffstream/restinio-conan-example/blob/e008723ebe2eb7cf6d5be98dcac8636acfdc7e18/ubuntu1604.Dockerfile#L11