/[gentoo-x86]/eclass/cuda.eclass
Gentoo

Diff of /eclass/cuda.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.4
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cuda.eclass,v 1.2 2013/06/22 12:37:28 jlec Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cuda.eclass,v 1.4 2014/09/17 10:21:37 jlec Exp $
4 4
5inherit toolchain-funcs versionator 5inherit flag-o-matic toolchain-funcs versionator
6 6
7# @ECLASS: cuda.eclass 7# @ECLASS: cuda.eclass
8# @MAINTAINER: 8# @MAINTAINER:
9# Justin Lecher <jlec@gentoo.org> 9# Justin Lecher <jlec@gentoo.org>
10# @BLURB: Common functions for cuda packages 10# @BLURB: Common functions for cuda packages
94# @FUNCTION: cuda_sanitize 94# @FUNCTION: cuda_sanitize
95# @DESCRIPTION: 95# @DESCRIPTION:
96# Correct NVCCFLAGS by adding the necessary reference to gcc bindir and 96# Correct NVCCFLAGS by adding the necessary reference to gcc bindir and
97# passing CXXFLAGS to underlying compiler without disturbing nvcc. 97# passing CXXFLAGS to underlying compiler without disturbing nvcc.
98cuda_sanitize() { 98cuda_sanitize() {
99 local rawldflags=$(raw-ldflags)
99 # Be verbose if wanted 100 # Be verbose if wanted
100 [[ "${CUDA_VERBOSE}" == true ]] && NVCCFLAGS+=" -v" 101 [[ "${CUDA_VERBOSE}" == true ]] && NVCCFLAGS+=" -v"
101 102
102 # Tell nvcc where to find a compatible compiler 103 # Tell nvcc where to find a compatible compiler
103 NVCCFLAGS+=" $(cuda_gccdir -f)" 104 NVCCFLAGS+=" $(cuda_gccdir -f)"
104 105
105 # Tell nvcc which flags should be used for underlying C compiler 106 # Tell nvcc which flags should be used for underlying C compiler
106 NVCCFLAGS+=" --compiler-options=\"${CXXFLAGS}\"" 107 NVCCFLAGS+=" --compiler-options=\"${CXXFLAGS}\" --linker-options=\"${rawldflags// /,}\""
107 108
108 debug-print "Using ${NVCCFLAGS} for cuda" 109 debug-print "Using ${NVCCFLAGS} for cuda"
109 export NVCCFLAGS 110 export NVCCFLAGS
110} 111}
111 112

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20