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 Oct 29, 2024
1 parent fffbf7c commit f6b421c
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 @@ -18,12 +18,6 @@ if(POLICY CMP0135)
cmake_policy(SET CMP0135 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 @@ -781,15 +775,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 f6b421c

Please sign in to comment.