Skip to content

Commit bc4008f

Browse files
committed
Change ExternalFunctionTemplate.cpp to .cpp.in to avoid problems with clang
1 parent 2b0a2f6 commit bc4008f

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/libcadet/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# =============================================================================
22
# CADET
3-
#
3+
#
44
# Copyright © The CADET Authors
55
# Please see the CONTRIBUTORS.md file.
6-
#
6+
#
77
# All rights reserved. This program and the accompanying materials
88
# are made available under the terms of the GNU Public License v3.0 (or, at
99
# your option, any later version) which accompanies this distribution, and
@@ -215,9 +215,9 @@ foreach(BM IN LISTS LIBCADET_BINDINGMODEL_SOURCES)
215215
get_filename_component(BMFILEWE ${BM} NAME_WE)
216216
get_filename_component(BMFILE ${BM} NAME)
217217
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BMFILE}
218-
COMMAND templateCodeGen ${CMAKE_SOURCE_DIR}/src/libcadet/model/binding/ExternalFunctionTemplate.cpp ${BM} ${CMAKE_CURRENT_BINARY_DIR}/${BMFILE}
218+
COMMAND templateCodeGen ${CMAKE_SOURCE_DIR}/src/libcadet/model/binding/ExternalFunctionTemplate.cpp.in ${BM} ${CMAKE_CURRENT_BINARY_DIR}/${BMFILE}
219219
MAIN_DEPENDENCY ${BM}
220-
DEPENDS ${CMAKE_SOURCE_DIR}/src/libcadet/model/binding/ExternalFunctionTemplate.cpp
220+
DEPENDS ${CMAKE_SOURCE_DIR}/src/libcadet/model/binding/ExternalFunctionTemplate.cpp.in
221221
COMMENT "Generating code for ${BMFILEWE}"
222222
)
223223
list (APPEND LIBCADET_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${BMFILE}")
@@ -227,9 +227,9 @@ foreach(RM IN LISTS LIBCADET_REACTIONMODEL_SOURCES)
227227
get_filename_component(RMFILEWE ${RM} NAME_WE)
228228
get_filename_component(RMFILE ${RM} NAME)
229229
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${RMFILE}
230-
COMMAND templateCodeGen ${CMAKE_SOURCE_DIR}/src/libcadet/model/reaction/ExternalFunctionTemplate.cpp ${RM} ${CMAKE_CURRENT_BINARY_DIR}/${RMFILE}
230+
COMMAND templateCodeGen ${CMAKE_SOURCE_DIR}/src/libcadet/model/reaction/ExternalFunctionTemplate.cpp.in ${RM} ${CMAKE_CURRENT_BINARY_DIR}/${RMFILE}
231231
MAIN_DEPENDENCY ${RM}
232-
DEPENDS ${CMAKE_SOURCE_DIR}/src/libcadet/model/reaction/ExternalFunctionTemplate.cpp
232+
DEPENDS ${CMAKE_SOURCE_DIR}/src/libcadet/model/reaction/ExternalFunctionTemplate.cpp.in
233233
COMMENT "Generating code for ${RMFILEWE}"
234234
)
235235
list (APPEND LIBCADET_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${RMFILE}")
@@ -273,23 +273,23 @@ if (LAPACK_FOUND)
273273
add_library(libcadet_static STATIC $<TARGET_OBJECTS:libcadet_object>)
274274
set_target_properties(libcadet_static PROPERTIES OUTPUT_NAME cadet_static)
275275
target_link_libraries(libcadet_static PUBLIC CADET::CompileOptions CADET::LibOptions PRIVATE CADET::AD libcadet_nonlinalg_static SUNDIALS::sundials_idas ${SUNDIALS_NVEC_TARGET} ${TBB_TARGET} ${EIGEN_TARGET})
276-
276+
277277
# ---------------------------------------------------
278278
# Build the shared library
279279
# ---------------------------------------------------
280280

281281
add_library(libcadet_shared SHARED $<TARGET_OBJECTS:libcadet_object>)
282282
set_target_properties(libcadet_shared PROPERTIES OUTPUT_NAME cadet)
283283
target_link_libraries (libcadet_shared PUBLIC CADET::CompileOptions CADET::LibOptions PRIVATE CADET::AD libcadet_nonlinalg_static SUNDIALS::sundials_idas ${SUNDIALS_NVEC_TARGET} ${TBB_TARGET} ${EIGEN_TARGET})
284-
284+
285285
list(APPEND LIBCADET_TARGETS libcadet_nonlinalg_static libcadet_object libcadet_static libcadet_shared)
286286

287287
unset(LIB_LAPACK_DEFINE)
288288
endif ()
289289

290290
foreach(_TARGET IN LISTS LIBCADET_TARGETS)
291291
target_include_directories(${_TARGET}
292-
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
292+
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
293293
PRIVATE ${CMAKE_SOURCE_DIR}/src/libcadet ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
294294
)
295295
set_target_properties(${_TARGET} PROPERTIES DEBUG_POSTFIX _d VERSION ${CADET_VERSION} SOVERSION "0")

src/libcadet/model/binding/ExternalFunctionTemplate.cpp renamed to src/libcadet/model/binding/ExternalFunctionTemplate.cpp.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// =============================================================================
22
// CADET
3-
//
3+
//
44
// Copyright © The CADET Authors
55
// Please see the CONTRIBUTORS.md file.
6-
//
6+
//
77
// All rights reserved. This program and the accompanying materials
88
// are made available under the terms of the GNU Public License v3.0 (or, at
99
// your option, any later version) which accompanies this distribution, and
1010
// is available at http://www.gnu.org/licenses/gpl.html
1111
// =============================================================================
1212

1313
/**
14-
* @file
14+
* @file
1515
* Template for external function support in binding models.
1616
* This file serves as a template for generating parameter handler classes that
1717
* hold, configure, and update parameters, which may also depend on external
@@ -174,7 +174,7 @@ class {{ name }} : public cadet::model::ConstParamHandlerBase
174174

175175
protected:
176176
inline bool validateConfig(unsigned int nComp, unsigned int const* nBoundStates);
177-
177+
178178
ConstParams _localParams;
179179

180180
{% for p in parameters %}
@@ -242,12 +242,12 @@ class {{ externalName }} : public cadet::model::ExternalParamHandlerBase
242242
{% endfor %}
243243
{% endif %}
244244
};
245-
245+
246246
typedef VariableParams params_t;
247247
typedef ConstBufferedScalar<params_t> ParamsHandle;
248248

249249
static inline const char* identifier() CADET_NOEXCEPT;
250-
250+
251251
{{ externalName }}() CADET_NOEXCEPT
252252
{% if exists("constantParameters") %}
253253
:
@@ -412,7 +412,7 @@ class {{ externalName }} : public cadet::model::ExternalParamHandlerBase
412412

413413
protected:
414414
inline bool validateConfig(unsigned int nComp, unsigned int const* nBoundStates);
415-
415+
416416
ConstParams _constParams;
417417

418418
{% for p in parameters %}

src/libcadet/model/reaction/ExternalFunctionTemplate.cpp renamed to src/libcadet/model/reaction/ExternalFunctionTemplate.cpp.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// =============================================================================
22
// CADET
3-
//
3+
//
44
// Copyright © The CADET Authors
55
// Please see the CONTRIBUTORS.md file.
6-
//
6+
//
77
// All rights reserved. This program and the accompanying materials
88
// are made available under the terms of the GNU Public License v3.0 (or, at
99
// your option, any later version) which accompanies this distribution, and
1010
// is available at http://www.gnu.org/licenses/gpl.html
1111
// =============================================================================
1212

1313
/**
14-
* @file
14+
* @file
1515
* Template for external function support in reaction models.
1616
* This file serves as a template for generating parameter handler classes that
1717
* hold, configure, and update parameters, which may also depend on external
@@ -242,12 +242,12 @@ class {{ externalName }} : public cadet::model::ExternalParamHandlerBase
242242
{% endfor %}
243243
{% endif %}
244244
};
245-
245+
246246
typedef VariableParams params_t;
247247
typedef ConstBufferedScalar<params_t> ParamsHandle;
248248

249249
static inline const char* identifier() CADET_NOEXCEPT;
250-
250+
251251
{{ externalName }}() CADET_NOEXCEPT
252252
{% if exists("constantParameters") %}
253253
:

0 commit comments

Comments
 (0)