Skip to content

Nvtx: fix recipe and add v3.2.1 #27583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/nvtx/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.2.1":
url: "https://github.com/NVIDIA/NVTX/archive/v3.2.1.tar.gz"
sha256: "737c3035f0e43a2252e7cd94c3f26e11e169f624236efe31794f044ce44a70af"
"3.1.0":
url: "https://github.com/NVIDIA/NVTX/archive/v3.1.0.tar.gz"
sha256: "dc4e4a227d04d3da46ad920dfee5f7599ac8d6b2ee1809c9067110fb1cc71ced"
Expand Down
1 change: 1 addition & 0 deletions recipes/nvtx/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def build(self):
def package(self):
copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
copy(self, "*.h", src=os.path.join(self.source_folder, "c", "include"), dst=os.path.join(self.package_folder, "include"))
copy(self, "*.hpp", src=os.path.join(self.source_folder, "c", "include"), dst=os.path.join(self.package_folder, "include"))

def package_info(self):
self.cpp_info.bindirs = []
Expand Down
11 changes: 7 additions & 4 deletions recipes/nvtx/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES C)
project(test_package LANGUAGES C CXX)

find_package(nvtx REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(${PROJECT_NAME} PRIVATE nvtx::nvtx)
target_compile_features(${PROJECT_NAME} PRIVATE c_std_99)
add_executable(${PROJECT_NAME}_c test_package.c)
target_link_libraries(${PROJECT_NAME}_c PRIVATE nvtx::nvtx)
target_compile_features(${PROJECT_NAME}_c PRIVATE c_std_99)

add_executable(${PROJECT_NAME}_cxx test_package.cpp)
target_link_libraries(${PROJECT_NAME}_cxx PRIVATE nvtx::nvtx)
4 changes: 3 additions & 1 deletion recipes/nvtx/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ def build(self):

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c")
self.run(bin_path, env="conanrun")
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cxx")
self.run(bin_path, env="conanrun")
10 changes: 10 additions & 0 deletions recipes/nvtx/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdlib.h>
#include <nvtx3/nvtx3.hpp>

int main()
{
nvtxInitialize(NULL);
nvtxRangeId_t main_range = nvtxRangeStartA("main");
nvtxRangeEnd(main_range);
return EXIT_SUCCESS;
}
2 changes: 2 additions & 0 deletions recipes/nvtx/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.2.1":
folder: all
"3.1.0":
folder: all
"3.0.1":
Expand Down