Skip to content

Commit

Permalink
Bugfix: detect Linux in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
Keita Iwabuchi committed Jan 30, 2024
1 parent 481576b commit bb2f85a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function(add_common_compile_options name)
target_compile_options(${name} PRIVATE $<$<CONFIG:Debug>:-Og>)
target_compile_options(${name} PRIVATE $<$<CONFIG:Debug>:-g3>)
target_compile_options(${name} PRIVATE $<$<CONFIG:Debug>:-Wextra>)
if (Linux)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_compile_options(${name} PRIVATE $<$<CONFIG:Debug>:-pg>)
endif ()

Expand All @@ -225,7 +225,7 @@ function(add_common_compile_options name)
# Release with debug info
target_compile_options(${name} PRIVATE $<$<CONFIG:RelWithDebInfo>:-Ofast>)
target_compile_options(${name} PRIVATE $<$<CONFIG:RelWithDebInfo>:-g3>)
if (Linux)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_compile_options(${name} PRIVATE $<$<CONFIG:RelWithDebInfo>:-pg>)
endif ()
endfunction()
Expand Down
2 changes: 1 addition & 1 deletion tutorial/nvmw21/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(CMAKE_CXX_FLAGS "-Wall -pthread")

# Debug
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
if (Linux)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
endif ()

Expand Down
2 changes: 1 addition & 1 deletion verification/sparse_copy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_metall_executable(verify_sparse_copy verify_sparse_copy.cpp)

if (Linux)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_metall_executable(verify_sparse_copy_syscalls verify_sparse_copy_syscalls.cpp)
endif ()

0 comments on commit bb2f85a

Please sign in to comment.