Skip to content

Commit

Permalink
Merge branch 'main' into analyse-node-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
nickerso authored Nov 11, 2024
2 parents 9499948 + 5882718 commit 95d180a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,38 @@ jobs:
os: windows-latest
bindings_python: ON
build_shared: OFF
unit_tests: ON
set_path: $env:Path="C:\libxml2\bin;C:\zlib\bin;"+$env:Path
additional_cmake_options: -DLIBXML2_INCLUDE_DIR="C:\libxml2\include\libxml2" -DLIBXML2_LIBRARY="C:\libxml2\lib\libxml2.lib" -DZLIB_INCLUDE_DIR="C:\zlib\include" -DZLIB_LIBRARY="C:\zlib\lib\z_dll.lib"
- name: 'Windows shared - C++/Python'
os: windows-latest
bindings_python: ON
build_shared: ON
unit_tests: ON
set_path: $env:Path="C:\libxml2\bin;C:\zlib\bin;"+$env:Path
additional_cmake_options: -DLIBXML2_INCLUDE_DIR="C:\libxml2\include\libxml2" -DLIBXML2_LIBRARY="C:\libxml2\lib\libxml2.lib" -DZLIB_INCLUDE_DIR="C:\zlib\include" -DZLIB_LIBRARY="C:\zlib\lib\z_dll.lib"
- name: 'Linux static - C++ (build only)'
- name: 'Linux static - C++'
os: ubuntu-latest
bindings_python: OFF
build_shared: OFF
unit_tests: OFF
- name: 'Linux shared - C++/Python'
os: ubuntu-latest
bindings_python: ON
build_shared: ON
unit_tests: ON
- name: 'macOS static - C++ (Intel)'
os: macos-13
bindings_python: OFF
build_shared: OFF
unit_tests: ON
- name: 'macOS shared - C++/Python (Intel)'
os: macos-13
bindings_python: ON
build_shared: ON
unit_tests: ON
- name: 'macOS static - C++ (ARM)'
os: macos-latest
bindings_python: OFF
build_shared: OFF
unit_tests: ON
- name: 'macOS shared - C++/Python (ARM)'
os: macos-latest
bindings_python: ON
build_shared: ON
unit_tests: ON
steps:
- name: Check out libCellML
uses: actions/checkout@v4
Expand All @@ -74,7 +66,7 @@ jobs:
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
uses: cscouto/buildcache-action@v1
with:
cache_key: ${{ matrix.os }}-${{ matrix.build_shared }}
- name: Configure MSVC (Windows only)
Expand All @@ -99,13 +91,12 @@ jobs:
mkdir build
cd build
${{ matrix.set_path }}
cmake -G Ninja -DBINDINGS_PYTHON=${{ matrix.bindings_python }} -DBUILD_SHARED=${{ matrix.build_shared }} -DCOVERAGE=OFF -DLLVM_COVERAGE=OFF -DMEMCHECK=OFF -DUNIT_TESTS=${{ matrix.unit_tests }} ${{ matrix.additional_cmake_options }} ..
cmake -G Ninja -DBINDINGS_PYTHON=${{ matrix.bindings_python }} -DBUILD_SHARED=${{ matrix.build_shared }} -DCOVERAGE=OFF -DLLVM_COVERAGE=OFF -DMEMCHECK=OFF -DUNIT_TESTS=ON ${{ matrix.additional_cmake_options }} ..
- name: Build libCellML
run: |
cd build
ninja
- name: Unit testing
if: ${{ matrix.unit_tests == 'ON' }}
run: |
cd build
ninja test
Expand All @@ -124,7 +115,7 @@ jobs:
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
uses: cscouto/buildcache-action@v1
- name: Install Emscripten
run: |
brew install --overwrite emscripten
Expand Down Expand Up @@ -193,7 +184,7 @@ jobs:
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
uses: cscouto/buildcache-action@v1
- name: Install LLVM
run: |
brew install --overwrite llvm
Expand All @@ -219,7 +210,7 @@ jobs:
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
uses: cscouto/buildcache-action@v1
- name: Install Valgrind
run: |
sudo apt update
Expand All @@ -244,7 +235,7 @@ jobs:
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: mikehardy/buildcache-action@v2
uses: cscouto/buildcache-action@v1
- name: Install Doxygen
run: |
sudo apt update
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ set_target_properties(cellml PROPERTIES
COMPATIBLE_INTERFACE_STRING ${PROJECT_VERSION_MAJOR}
)

if(NOT LIBCELLML_BUILD_SHARED AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set_target_properties(cellml PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()

set(DEBUG_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp
)
Expand Down
2 changes: 0 additions & 2 deletions src/analyserequationast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ limitations under the License.

#include "analyserequationast_p.h"

#include "libcellml/undefines.h"

namespace libcellml {

void AnalyserEquationAst::AnalyserEquationAstImpl::populate(AnalyserEquationAst::Type type,
Expand Down
3 changes: 3 additions & 0 deletions src/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ if(LIBCELLML_BINDINGS_PYTHON) # Or any other bindings that use SWIG.
endif()

if(LIBCELLML_BINDINGS_PYTHON)
if(NOT LIBCELLML_BUILD_SHARED)
message(WARNING "It is **not** recommended to build the Python bindings with static libraries.")
endif()
add_subdirectory(python)
endif()

Expand Down
3 changes: 3 additions & 0 deletions src/bindings/interface/analyserequationast.i
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"Swaps the left and right children of this :class:`AnalyserEquationAst` object.";

%{
#include <float.h>
#include <math.h>

#include "libcellml/analyserequationast.h"
%}

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ set_source_files_properties(${SWIG_INTERFACE_SRCS} PROPERTIES

set(SETUP_PY_PACKAGE_FILES "'\${TARGET_FILE_NAME_cellml}'")
list(APPEND FINALISE_PYTHON_BINDINGS_ARGUMENTS -DTARGET_FILE_NAME_cellml=$<TARGET_FILE_NAME:cellml>)
if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND LIBCELLML_BUILD_SHARED)
list(APPEND SETUP_PY_PACKAGE_FILES "'\${TARGET_SONAME_FILE_NAME_cellml}'")
list(APPEND FINALISE_PYTHON_BINDINGS_ARGUMENTS -DTARGET_SONAME_FILE_NAME_cellml=$<TARGET_SONAME_FILE_NAME:cellml>)
set(_GENERATOR_EXPRESSION_LIBCELLML_SONAME $<TARGET_SONAME_FILE:cellml>)
Expand Down
1 change: 1 addition & 0 deletions tests/gtest/cmake/internal_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function(cxx_library_with_type name type cxx_flags)
add_library(${name} ${type} ${ARGN})
set_target_properties(${name}
PROPERTIES
POSITION_INDEPENDENT_CODE 1
COMPILE_FLAGS "${cxx_flags}")
if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
set_target_properties(${name}
Expand Down

0 comments on commit 95d180a

Please sign in to comment.