Skip to content

Commit

Permalink
Use macro instead of function
Browse files Browse the repository at this point in the history
Proper return() is supported beginning with CMake 3.25 only
  • Loading branch information
franzpoeschel committed Jul 19, 2024
1 parent c6bd81d commit 6abe9ec
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ if(POLICY CMP0127)
cmake_policy(SET CMP0127 NEW)
endif()

# return() should check its arguments
# https://cmake.org/cmake/help/latest/policy/CMP0140.html
if(POLICY CMP0140)
cmake_policy(SET CMP0140 NEW)
endif()


# No in-Source builds #########################################################
#
Expand Down Expand Up @@ -853,15 +847,14 @@ if(openPMD_BUILD_TESTING)
target_compile_definitions(CatchRunner PUBLIC openPMD_HAVE_MPI=1)
endif()

function(additional_testing_sources test_name out_list)
macro(additional_testing_sources test_name out_list)
if(${test_name} STREQUAL "SerialIO")
list(APPEND ${out_list}
test/Files_SerialIO/close_iteration_test.cpp
test/Files_SerialIO/filebased_write_test.cpp
)
endif()
return(PROPAGATE ${out_list})
endfunction()
endmacro()

foreach(testname ${openPMD_TEST_NAMES})
set(ADDITIONAL_SOURCE_FILES "")
Expand Down

0 comments on commit 6abe9ec

Please sign in to comment.