Skip to content

Commit

Permalink
disabling python build on windows if building for 32 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Feb 14, 2025
1 parent a84051f commit 8a76d88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ jobs:
uses: actions/checkout@v3

- name: Run Cmake
run: cmake -S . -B build -A ${{ matrix.architecture }} -D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
run: |
if [ "${{ matrix.architecture }}" == "Win32" ]; then
cmake -S . -B build -A ${{ matrix.architecture }} -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -DOPEN_ATMOS_ENABLE_PYTHON_LIBRARY=OFF
else
cmake -S . -B build -A ${{ matrix.architecture }} -D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
fi

- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 10
Expand Down
7 changes: 5 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ add_library(open_atmos::mechanism_configuration ALIAS mechanism_configuration)

target_compile_features(mechanism_configuration PUBLIC cxx_std_20)

# Add the -fPIC flag for position-independent code
set_target_properties(mechanism_configuration PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(OPEN_ATMOS_ENABLE_PYTHON_LIBRARY)
# Add the -fPIC flag for position-independent code if we are building the python library
# so that it links correctly on linux
set_target_properties(mechanism_configuration PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()

target_sources(mechanism_configuration
PRIVATE
Expand Down

0 comments on commit 8a76d88

Please sign in to comment.