Merge pull request #142 from dotnet/anurse/fix-ubuntu-cmake

Fix cmake dependency on Ubuntu

Thanks @anurse!!
This commit is contained in:
Piotr Puszkiewicz 2015-11-03 10:42:51 -08:00
commit f176ae9387
2 changed files with 7 additions and 10 deletions

View file

@ -12,15 +12,7 @@ RUN apt-get update && \
RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | tee /etc/apt/sources.list.d/llvm.list && \ RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | tee /etc/apt/sources.list.d/llvm.list && \
curl http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \ curl http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \
apt-get update && \ apt-get update && \
apt-get install -y debhelper build-essential devscripts git liblttng-ust-dev lldb-3.6-dev lldb-3.6 clang apt-get install -y debhelper build-essential devscripts git liblttng-ust-dev lldb-3.6-dev lldb-3.6 clang cmake
# Install latest cmake
RUN mkdir -p /opt/src/cmake && \
cd /opt/src/cmake && \
curl -O https://cmake.org/files/v3.4/cmake-3.4.0-rc2-Linux-x86_64.tar.gz && \
tar xzf cmake-3.4.0-rc2-Linux-x86_64.tar.gz && \
cd cmake-3.4.0-rc2-Linux-x86_64 && \
ln -s /opt/src/cmake/cmake-3.4.0-rc2-Linux-x86_64/bin/cmake /usr/local/bin/cmake
# Use clang as c++ compiler # Use clang as c++ compiler
RUN update-alternatives --set c++ /usr/bin/clang++ RUN update-alternatives --set c++ /usr/bin/clang++

View file

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.1) cmake_minimum_required (VERSION 2.6)
project (corehost) project (corehost)
set (CMAKE_CXX_STANDARD 11) set (CMAKE_CXX_STANDARD 11)
include_directories(inc) include_directories(inc)
@ -27,6 +27,11 @@ endif()
add_executable(corehost ${SOURCES}) add_executable(corehost ${SOURCES})
# Older CMake doesn't support CMAKE_CXX_STANDARD and GCC/Clang need a switch to enable C++ 11
if(${CMAKE_CXX_COMPILER_ID} MATCHES "(Clang|GCC)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_definitions(-D__LINUX__) add_definitions(-D__LINUX__)
target_link_libraries (corehost "dl") target_link_libraries (corehost "dl")