Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Peter Stroia-Williams
CMake
Commits
45c95a33
Commit
45c95a33
authored
Dec 05, 2018
by
Brad King
💬
Browse files
Merge branch 'cuda-external' into release-3.13
Merge-request: !2704
parents
62942969
7b742134
Changes
6
Hide whitespace changes
Inline
Side-by-side
Source/cmMakefileExecutableTargetGenerator.cxx
View file @
45c95a33
...
...
@@ -84,6 +84,10 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
bool
relink
)
{
#ifdef CMAKE_BUILD_WITH_CMAKE
if
(
!
this
->
GlobalGenerator
->
GetLanguageEnabled
(
"CUDA"
))
{
return
;
}
const
std
::
string
cuda_lang
(
"CUDA"
);
cmGeneratorTarget
::
LinkClosure
const
*
closure
=
this
->
GeneratorTarget
->
GetLinkClosure
(
this
->
ConfigName
);
...
...
Source/cmNinjaNormalTargetGenerator.cxx
View file @
45c95a33
...
...
@@ -558,6 +558,10 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
void
cmNinjaNormalTargetGenerator
::
WriteDeviceLinkStatement
()
{
if
(
!
this
->
GetGlobalGenerator
()
->
GetLanguageEnabled
(
"CUDA"
))
{
return
;
}
cmGeneratorTarget
&
genTarget
=
*
this
->
GetGeneratorTarget
();
// determine if we need to do any device linking for this target
...
...
Source/cmVisualStudio10TargetGenerator.cxx
View file @
45c95a33
...
...
@@ -3331,7 +3331,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std
::
vector
<
std
::
string
>
vsTargetVec
;
this
->
AddLibraries
(
cli
,
libVec
,
vsTargetVec
,
config
);
if
(
std
::
find
(
linkClosure
->
Languages
.
begin
(),
linkClosure
->
Languages
.
end
(),
"CUDA"
)
!=
linkClosure
->
Languages
.
end
())
{
"CUDA"
)
!=
linkClosure
->
Languages
.
end
()
&&
this
->
CudaOptions
[
config
]
!=
nullptr
)
{
switch
(
this
->
CudaOptions
[
config
]
->
GetCudaRuntime
())
{
case
cmVisualStudioGeneratorOptions
::
CudaRuntimeStatic
:
libVec
.
push_back
(
"cudadevrt.lib"
);
...
...
Tests/RunCMake/Languages/ExternalCUDA.cmake
0 → 100644
View file @
45c95a33
enable_language
(
C
)
add_library
(
ext_cuda IMPORTED STATIC
)
set_property
(
TARGET ext_cuda PROPERTY IMPORTED_LOCATION
"/does_not_exist"
)
set_property
(
TARGET ext_cuda PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES
"CUDA"
)
add_executable
(
main empty.c
)
target_link_libraries
(
main ext_cuda
)
Tests/RunCMake/Languages/RunCMakeTest.cmake
View file @
45c95a33
...
...
@@ -6,3 +6,5 @@ run_cmake(link-libraries-TARGET_FILE-genex)
run_cmake
(
link-libraries-TARGET_FILE-genex-ok
)
run_cmake
(
DetermineFail
)
run_cmake
(
ExternalCUDA
)
Tests/RunCMake/Languages/empty.c
0 → 100644
View file @
45c95a33
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment