Skip to content

Commit

Permalink
Give shared-lib option and test install (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Jan 30, 2022
1 parent 7878207 commit 5cbc5ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,36 @@ jobs:
- uses: actions/checkout@v2

- name: Configure
shell: bash
# Configure CMake in a 'buildX' subdirectory.
# We can't use `build` as `BUILD` is already taken by the bazel build file.
# On Mac and Windows this leads to a conflict.
run: |
mkdir -p buildX
cd buildX
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake -DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}/install_dir \
..
- name: Build
- name: Build shared
run: |
cmake -DBUILD_SHARED_LIBS=ON buildX
cmake --build buildX --config ${{ matrix.build_type }}
- name: Install shared
run: |
cmake --install buildX --config ${{ matrix.build_type }}
- name: Build static
run: |
cmake -DBUILD_SHARED_LIBS=OFF buildX
cmake --build buildX --config ${{ matrix.build_type }}
- name: Install static
run: |
cmake --install buildX --config ${{ matrix.build_type }}
- name: Test
if: runner.os != 'Windows'
working-directory: ${{ github.workspace }}/buildX
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.0)
project(double-conversion VERSION 3.2.0)

option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)

if(BUILD_SHARED_LIBS AND MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
Expand Down

0 comments on commit 5cbc5ec

Please sign in to comment.