Skip to content

Commit 5c0a26a

Browse files
authored
Merge pull request #1247 from agarny/issue1243
Code generator: use different arrays for constants, computed constants, and algebraic variables
2 parents 22bdf57 + bd6d67d commit 5c0a26a

File tree

248 files changed

+17931
-12530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+17931
-12530
lines changed

cmake/common.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,13 @@ function(redhat_based _RESULT)
313313
endif()
314314
set(${_RESULT} ${_REDHAT_BASED} PARENT_SCOPE)
315315
endfunction()
316+
317+
function(apply_libxml2_settings _TARGET)
318+
if(HAVE_LIBXML2_CONFIG)
319+
target_link_libraries(${_TARGET} PUBLIC ${LIBXML2_TARGET_NAME})
320+
else()
321+
target_include_directories(${_TARGET} PUBLIC ${LIBXML2_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
322+
target_link_libraries(${_TARGET} PUBLIC ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
323+
target_compile_definitions(${_TARGET} PUBLIC ${LIBXML2_DEFINITIONS})
324+
endif()
325+
endfunction()

src/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ set(MODULE_HEADER_FILES
121121
)
122122

123123
set(GIT_HEADER_FILES
124+
${CMAKE_CURRENT_SOURCE_DIR}/analyser_p.h
124125
${CMAKE_CURRENT_SOURCE_DIR}/analyserequation_p.h
125126
${CMAKE_CURRENT_SOURCE_DIR}/analyserequationast_p.h
126127
${CMAKE_CURRENT_SOURCE_DIR}/analyserexternalvariable_p.h
@@ -133,6 +134,7 @@ set(GIT_HEADER_FILES
133134
${CMAKE_CURRENT_SOURCE_DIR}/debug.h
134135
${CMAKE_CURRENT_SOURCE_DIR}/entity_p.h
135136
${CMAKE_CURRENT_SOURCE_DIR}/generator_p.h
137+
${CMAKE_CURRENT_SOURCE_DIR}/generatorprofile_p.h
136138
${CMAKE_CURRENT_SOURCE_DIR}/generatorprofilesha1values.h
137139
${CMAKE_CURRENT_SOURCE_DIR}/generatorprofiletools.h
138140
${CMAKE_CURRENT_SOURCE_DIR}/internaltypes.h
@@ -196,13 +198,7 @@ else()
196198
target_include_directories(cellml PUBLIC ${ZLIB_INCLUDE_DIRS})
197199
endif()
198200

199-
if(HAVE_LIBXML2_CONFIG)
200-
target_link_libraries(cellml PUBLIC ${LIBXML2_TARGET_NAME})
201-
else()
202-
target_include_directories(cellml PUBLIC ${LIBXML2_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
203-
target_link_libraries(cellml PUBLIC ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
204-
target_compile_definitions(cellml PUBLIC ${LIBXML2_DEFINITIONS})
205-
endif()
201+
apply_libxml2_settings(cellml)
206202

207203
# Use target compile features to propagate features to consuming projects.
208204
target_compile_features(cellml PUBLIC cxx_std_17)
@@ -238,6 +234,8 @@ target_include_directories(cellml_debug_utilities
238234
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/api>
239235
)
240236

237+
apply_libxml2_settings(cellml_debug_utilities)
238+
241239
set_target_properties(cellml_debug_utilities PROPERTIES
242240
CXX_VISIBILITY_PRESET hidden
243241
DEBUG_POSTFIX d

0 commit comments

Comments
 (0)