diff options
| author | KunoiSayami <[email protected]> | 2022-06-09 02:42:07 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2022-06-09 02:42:07 +0800 |
| commit | 55b3c4bb5b8ad9ef23eec125048ff8e4fea4f7fe (patch) | |
| tree | 13c74de3965820a6203264dbbefb3f6312733a88 /CMakeLists.txt | |
| parent | 26721db77103fc749fc4a1ce2d85cdf7c1248780 (diff) | |
feat: Support multiple target and show image script
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index faf0f29..7e8ff4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,36 @@ if (false) endif () # from: Peter -target_link_libraries(lockfree m) -target_link_libraries(lockfree stdc++) +target_link_libraries(lockfree m stdc++) set_target_properties(lockfree PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +function(build_different_target is_random build_size step_size) + + string(CONCAT basic_name "lockfree_" "${build_size}" "_" "${step_size}") + + message(STATUS "different target: ${basic_name} ${is_random}") + add_executable("${basic_name}" "") + + target_sources("${basic_name}" + PRIVATE + main.cu + ) + + #add_definitions("${basic_name}" -DBUILD_SIZE=${build_size} -DSTEP_SIZE=${step_size}) + target_compile_definitions("${basic_name}" PRIVATE -DBUILD_SIZE=${build_size} -DSTEP_SIZE=${step_size}) + if ("${is_random}") + target_compile_definitions("${basic_name} PRIVATE -DRANDOM_TARGET") + endif () + + #target_link_libraries(basic_name m stdc++) + + set_target_properties("${basic_name}" PROPERTIES + CUDA_SEPARABLE_COMPILATION ON) + +endfunction() + +build_different_target(false 1024 2) +build_different_target(false 1024 4) +build_different_target(false 1024 8) |
