diff --git a/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt b/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt index 1a1bbeae..57ea0ced 100644 --- a/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt +++ b/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt @@ -28,11 +28,11 @@ add_custom_target(clobber) add_custom_target(testrun) add_test(NAME test-cuda-shared-memory-shared_memory - COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/shared_memory.ll" + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/shared_memory.ll" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_test(NAME test-cuda-shared-memory-extern_shared_memory - COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/extern_shared_memory.ll" + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/extern_shared_memory.ll" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set_tests_properties(test-cuda-shared-memory-shared_memory diff --git a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt index bc96a297..c0edbb3a 100644 --- a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt +++ b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt @@ -46,4 +46,17 @@ install(FILES dsl-gpu64.ll DESTINATION bin) # 'dsl' will load dsl-gpu64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). -file(COPY dsl-gpu64.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") +add_custom_command( + TARGET dsl + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/dsl-gpu64.ll" "$" +) +if (WIN32) +add_custom_command( + TARGET dsl + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_BINARY_DIR}/nvvm64_40_0.dll" "$" +) +endif () diff --git a/Samples/7_libNVVM/ptxgen/CMakeLists.txt b/Samples/7_libNVVM/ptxgen/CMakeLists.txt index 591b43e1..fb8a5855 100644 --- a/Samples/7_libNVVM/ptxgen/CMakeLists.txt +++ b/Samples/7_libNVVM/ptxgen/CMakeLists.txt @@ -43,4 +43,18 @@ else (WIN32) endif (WIN32) install(TARGETS ptxgen DESTINATION bin) -file(COPY test.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") + +add_custom_command( + TARGET ptxgen + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/test.ll" "$" +) +if (WIN32) +add_custom_command( + TARGET ptxgen + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_BINARY_DIR}/nvvm64_40_0.dll" "$" +) +endif () diff --git a/Samples/7_libNVVM/simple/CMakeLists.txt b/Samples/7_libNVVM/simple/CMakeLists.txt index 30d192a8..08672a1e 100644 --- a/Samples/7_libNVVM/simple/CMakeLists.txt +++ b/Samples/7_libNVVM/simple/CMakeLists.txt @@ -45,4 +45,17 @@ install(FILES simple-gpu64.ll DESTINATION bin) # 'simple' will load simple-gpu64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). -file(COPY simple-gpu64.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") +add_custom_command( + TARGET simple + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/simple-gpu64.ll" "$" +) +if (WIN32) +add_custom_command( + TARGET simple + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_BINARY_DIR}/nvvm64_40_0.dll" "$" +) +endif () diff --git a/Samples/7_libNVVM/syscalls/CMakeLists.txt b/Samples/7_libNVVM/syscalls/CMakeLists.txt index 0f323058..48368041 100644 --- a/Samples/7_libNVVM/syscalls/CMakeLists.txt +++ b/Samples/7_libNVVM/syscalls/CMakeLists.txt @@ -26,11 +26,11 @@ add_test(NAME test-syscalls-malloc-free - COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/malloc-free.ll" + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/malloc-free.ll" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_test(NAME test-syscalls-vprintf - COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/vprintf.ll" + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/vprintf.ll" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set_tests_properties(test-syscalls-vprintf test-syscalls-malloc-free diff --git a/Samples/7_libNVVM/uvmlite/CMakeLists.txt b/Samples/7_libNVVM/uvmlite/CMakeLists.txt index 34d9bef0..dbf1d723 100644 --- a/Samples/7_libNVVM/uvmlite/CMakeLists.txt +++ b/Samples/7_libNVVM/uvmlite/CMakeLists.txt @@ -49,4 +49,17 @@ install(FILES uvmlite64.ll DESTINATION bin) # 'uvmlite' will load uvmlite64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). -file(COPY uvmlite64.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") +add_custom_command( + TARGET uvmlite + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/uvmlite64.ll" "$" +) +if (WIN32) +add_custom_command( + TARGET uvmlite + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_BINARY_DIR}/nvvm64_40_0.dll" "$" +) +endif ()