Skip to content

Commit 618e0bf

Browse files
committed
Move SWIG-specific properties into the swig-only conditional
1 parent 207c621 commit 618e0bf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ set(FLIBCPP_NAMESPACE Flibcpp::)
137137
set(FLIBCPP_LIBRARIES)
138138

139139
function(flibcpp_add_module name)
140-
set(src_file "${FLIBCPP_INTERFACE_DIR}/${name}.i")
141-
# We're using C++
142-
set_property(SOURCE "${src_file}" PROPERTY CPLUSPLUS ON)
143-
# We need to include the source directory
144-
set_property(SOURCE "${src_file}" PROPERTY USE_TARGET_INCLUDE_DIRECTORIES ON)
145-
146140
if (FLIBCPP_USE_SWIG)
147141
# SWIG is available; actually generate the library dynamically.
142+
143+
set(src_file "${FLIBCPP_INTERFACE_DIR}/${name}.i")
144+
# We're using C++
145+
set_property(SOURCE "${src_file}" PROPERTY CPLUSPLUS ON)
146+
# We need to include the source directory
147+
set_property(SOURCE "${src_file}" PROPERTY USE_TARGET_INCLUDE_DIRECTORIES ON)
148+
148149
# Create the library
149150
swig_add_library(${name}
150151
LANGUAGE Fortran

0 commit comments

Comments
 (0)