Skip to content

Commit 3101857

Browse files
committed
Fix non-Python builds
1 parent dc23e0c commit 3101857

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,13 +733,17 @@ if(openPMD_USE_INVASIVE_TESTS)
733733
target_compile_definitions(openPMD PRIVATE openPMD_USE_INVASIVE_TESTS=1)
734734
endif()
735735

736-
foreach(target openPMD openPMD.py)
736+
function(set_filesystem_header_for_target target)
737737
if(openPMD_USE_FILESYSTEM_HEADER)
738738
target_compile_definitions(${target} PRIVATE openPMD_USE_FILESYSTEM_HEADER=1)
739739
else()
740740
target_compile_definitions(${target} PRIVATE openPMD_USE_FILESYSTEM_HEADER=0)
741741
endif()
742-
endforeach()
742+
endfunction()
743+
set_filesystem_header_for_target(openPMD)
744+
if(openPMD_HAVE_PYTHON)
745+
set_filesystem_header_for_target(openPMD.py)
746+
endif()
743747

744748
if(openPMD_BUILD_TESTING)
745749
# compile Catch2 implementation part separately

0 commit comments

Comments
 (0)