Skip to content

Commit f0a1456

Browse files
committed
Fix non-Python builds
1 parent db9b0d2 commit f0a1456

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
@@ -735,13 +735,17 @@ if(openPMD_USE_INVASIVE_TESTS)
735735
target_compile_definitions(openPMD PRIVATE openPMD_USE_INVASIVE_TESTS=1)
736736
endif()
737737

738-
foreach(target openPMD openPMD.py)
738+
function(set_filesystem_header_for_target target)
739739
if(openPMD_USE_FILESYSTEM_HEADER)
740740
target_compile_definitions(${target} PRIVATE openPMD_USE_FILESYSTEM_HEADER=1)
741741
else()
742742
target_compile_definitions(${target} PRIVATE openPMD_USE_FILESYSTEM_HEADER=0)
743743
endif()
744-
endforeach()
744+
endfunction()
745+
set_filesystem_header_for_target(openPMD)
746+
if(openPMD_HAVE_PYTHON)
747+
set_filesystem_header_for_target(openPMD.py)
748+
endif()
745749

746750
if(openPMD_BUILD_TESTING)
747751
# compile Catch2 implementation part separately

0 commit comments

Comments
 (0)