From 8e79563ea1a44688531c7b2c0cb8781579b4edb3 Mon Sep 17 00:00:00 2001 From: Seth Zegelstein Date: Sat, 11 Oct 2025 00:53:40 +0000 Subject: [PATCH] cmake: Fix conflicting optimization flags in debug builds - Change CONFIG:Debug to CONFIG:debug for case sensitivity - Remove trailing semicolons in flag lists - Replace $ with mutually exclusive $<$:...> for CUDA flags to avoid false branch evaluation on C++ files Fixes debug builds incorrectly getting both -O0 and -O3 flags. Signed-off-by: Seth Zegelstein --- src/CMakeLists.txt | 5 +++-- src/device/CMakeLists.txt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab6946b..4cc831d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -257,9 +257,10 @@ macro(nvshmem_library_set_base_config LIBNAME) target_compile_options(${LIBNAME} INTERFACE $<$,$>:-Xptxas -v> - PRIVATE $,-O0;-g;,-O3> + PRIVATE $,-O0;-g,-O3> $<$,$>:-Xptxas -v> - $,$>,-O0;-g;-G;,-O3> + $<$,$>:-O0;-g;-G> + $<$,$>:-O3> $,-msse,> $<$,$>:-t4> ) diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index 73f3e2b..d0275e3 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -139,9 +139,10 @@ macro(nvshmem_library_set_base_config LIBNAME) target_compile_options(${LIBNAME} INTERFACE $<$,$>:-Xptxas -v> - PRIVATE $,-O0;-g;,-O3> + PRIVATE $,-O0;-g,-O3> $<$,$>:-Xptxas -v> - $,$>,-O0;-g;-G;,-O3> + $<$,$>:-O0;-g;-G> + $<$,$>:-O3> $,-msse,> $<$,$>:-t4> )