Merge branch 'fix-QCC-compile-flags' into release

This commit is contained in:
Brad King 2014-07-17 09:41:40 -04:00
commit d8934eedaf
6 changed files with 41 additions and 27 deletions

View File

@ -0,0 +1,2 @@
include(Compiler/QCC)
__compiler_qcc(C)

View File

@ -0,0 +1,12 @@
include(Compiler/QCC)
__compiler_qcc(CXX)
# If the toolchain uses qcc for CMAKE_CXX_COMPILER instead of QCC, the
# default for the driver is not c++.
set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> -lang-c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> -lang-c++ <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")

View File

@ -0,0 +1,24 @@
#=============================================================================
# Copyright 2002-2014 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(Compiler/GNU)
macro(__compiler_qcc lang)
__compiler_gnu(${lang})
# http://www.qnx.com/developers/docs/6.4.0/neutrino/utilities/q/qcc.html#examples
set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-V")
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,")
set(CMAKE_DEPFILE_FLAGS_${lang} "-Wc,-MMD,<DEPFILE>,-MT,<OBJECT>,-MF,<DEPFILE>")
endmacro()

View File

@ -1,4 +0,0 @@
include(Platform/QNX)
__compiler_qcc(C)

View File

@ -1,4 +0,0 @@
include(Platform/QNX)
__compiler_qcc(CXX)

View File

@ -1,5 +1,8 @@
set(QNXNTO 1)
include(Platform/GNU)
unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
set(CMAKE_DL_LIBS "")
# Shared libraries with no builtin soname may not be linked safely by
@ -14,22 +17,3 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
endforeach()
include(Platform/GNU)
unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
macro(__compiler_qcc lang)
# http://www.qnx.com/developers/docs/6.4.0/neutrino/utilities/q/qcc.html#examples
set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-V")
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,")
set(CMAKE_DEPFILE_FLAGS_${lang} "-Wc,-MMD,<DEPFILE>,-MT,<OBJECT>,-MF,<DEPFILE>")
if (lang STREQUAL CXX)
# If the toolchain uses qcc for CMAKE_CXX_COMPILER instead of QCC, the
# default for the driver is not c++.
set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> -lang-c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
endif()
endmacro()