👷 add step for NVCC build #2676
This commit is contained in:
parent
3028e96ea5
commit
6773461d80
10
.github/workflows/ubuntu.yml
vendored
10
.github/workflows/ubuntu.yml
vendored
@ -101,3 +101,13 @@ jobs:
|
|||||||
run: cmake -S . -B build -DJSON_CI=On
|
run: cmake -S . -B build -DJSON_CI=On
|
||||||
- name: build
|
- name: build
|
||||||
run: cmake --build build --target ci_test_${{ matrix.compiler }}_cxx${{ matrix.standard }}
|
run: cmake --build build --target ci_test_${{ matrix.compiler }}_cxx${{ matrix.standard }}
|
||||||
|
|
||||||
|
ci_cuda_example:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ghcr.io/nlohmann/json-ci:main
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -DJSON_CI=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --target ci_cuda_example
|
||||||
|
|||||||
@ -835,6 +835,18 @@ foreach(COMPILER g++-4.8 g++-4.9 g++-5 g++-6 g++-7 g++-8 g++-9 g++-10 clang++-3.
|
|||||||
unset(COMPILER_TOOL CACHE)
|
unset(COMPILER_TOOL CACHE)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# CUDA example
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
add_custom_target(ci_cuda_example
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DCMAKE_BUILD_TYPE=Debug -GNinja
|
||||||
|
-DCMAKE_CUDA_HOST_COMPILER=g++-8
|
||||||
|
-S${PROJECT_SOURCE_DIR}/test/cuda_example -B${PROJECT_BINARY_DIR}/build_cuda_example
|
||||||
|
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_cuda_example
|
||||||
|
)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Clean up all generated files.
|
# Clean up all generated files.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.18)
|
||||||
project(json_cuda LANGUAGES CXX CUDA)
|
project(json_cuda LANGUAGES CUDA)
|
||||||
|
|
||||||
add_executable(json_cuda json_cuda.cpp)
|
add_executable(json_cuda json_cuda.cu)
|
||||||
set_source_files_properties(json_cuda.cpp PROPERTIES LANGUAGE CUDA)
|
|
||||||
target_include_directories(json_cuda PRIVATE ../../include)
|
target_include_directories(json_cuda PRIVATE ../../include)
|
||||||
target_compile_features(json_cuda PUBLIC cuda_std_11)
|
target_compile_features(json_cuda PUBLIC cuda_std_11)
|
||||||
set_target_properties(json_cuda PROPERTIES
|
set_target_properties(json_cuda PROPERTIES
|
||||||
CUDA_EXTENSIONS OFF
|
CUDA_EXTENSIONS OFF
|
||||||
CUDA_STANDARD_REQUIRED ON
|
CUDA_STANDARD_REQUIRED ON
|
||||||
CUDA_SEPARABLE_COMPILATION ON # Just needed if we need separable compilation; this adds -dc
|
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
#include <nlohmann/json.hpp>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{}
|
|
||||||
7
test/cuda_example/json_cuda.cu
Normal file
7
test/cuda_example/json_cuda.cu
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
nlohmann::ordered_json json = {"Test"};
|
||||||
|
json.dump();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user