Permalink
Browse files

Fix CMake builds for CMake >= 3.4

  • Loading branch information...
DolceTriade committed Dec 28, 2015
1 parent d91bb1f commit 201a279104453b96668bb397126d798db591c78e
Showing with 10 additions and 2 deletions.
  1. +10 −2 daemon/cmake/toolchain-pnacl.cmake
@@ -66,8 +66,16 @@ endif()
set(CMAKE_C_CREATE_STATIC_LIBRARY "${PNACLPYTHON_PREFIX}<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "${PNACLPYTHON_PREFIX}<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")

set(CMAKE_C_COMPILE_OBJECT "${PNACLPYTHON_PREFIX}<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_CXX_COMPILE_OBJECT "${PNACLPYTHON_PREFIX}<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
# CMake 3.4 introduced an <INCLUDES> substituion that didn't exist before. It will fail on older versions with it
# and fail on newer versions without it.
if (${CMAKE_VERSION} VERSION_LESS "3.4")
set(TOOLCHAIN_INCLUDE "")
else()
set(TOOLCHAIN_INCLUDE "<INCLUDES>")
endif()

set(CMAKE_C_COMPILE_OBJECT "${PNACLPYTHON_PREFIX}<CMAKE_C_COMPILER> <DEFINES> ${TOOLCHAIN_INCLUDE} <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_CXX_COMPILE_OBJECT "${PNACLPYTHON_PREFIX}<CMAKE_CXX_COMPILER> <DEFINES> ${TOOLCHAIN_INCLUDE} <FLAGS> -o <OBJECT> -c <SOURCE>")

set(CMAKE_C_LINK_EXECUTABLE "${PNACLPYTHON_PREFIX}<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
set(CMAKE_CXX_LINK_EXECUTABLE "${PNACLPYTHON_PREFIX}<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")

0 comments on commit 201a279

Please sign in to comment.