Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sandordargo committed Oct 11, 2024
1 parent db4f16f commit 3fcbcf4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
id: boost
shell: bash
run: |
run: |
DEPS_DIR="${{ github.workspace }}/deps"
BOOST_LIBRARIES="chrono,system,test"
BOOST_VERSION="1.70.0"
Expand All @@ -48,16 +48,24 @@ jobs:
if: matrix.os == 'macos-latest'
id: boost-macos
shell: bash
run: |
run: |
brew install boost
export BOOST_ROOT=$(brew --prefix boost)
echo "boost-root-dir=$BOOST_ROOT" >> "$GITHUB_OUTPUT"
- name: Verify Boost (MacOs)
if: matrix.os == 'macos-latest'
shell: bash
run: |
ls /opt/homebrew/opt/boost/lib
- name: Install vcpkg
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout master # Use a specific version if needed
./bootstrap-vcpkg.bat
- name: Install Boost (Windows)
if: matrix.os == 'windows-latest'
run: |
cd vcpkg
.\vcpkg.exe install boost-algorithm boost-assert boost-test boost-system boost-chrono
- name: Set build directory
id: strings
Expand All @@ -72,13 +80,23 @@ jobs:
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
-DBOOST_ROOT="./vcpkg/installed/x64-windows/"
-DBoost_LIBRARY_DIRS="./vcpkg/installed/x64-windows/lib"
-S ${{ github.workspace }} -DBoost_USE_STATIC_LIBS=OFF -DBoost_USE_STATIC_RUNTIME=OFF
- name: Configure CMake (MacOs)
if: matrix.os == 'macos-latest'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_PREFIX_PATH="/opt/homebrew/opt/boost" -DBoost_ROOT="/opt/homebrew/opt/boost" -DBOOST_LIBRARYDIR="/opt/homebrew/opt/boost/lib"
-S ${{ github.workspace }}
-DCMAKE_PREFIX_PATH="/opt/homebrew/opt/boost" -DBOOST_ROOT="/opt/homebrew/opt/boost" -DBoost_NO_BOOST_CMAKE=ON
-DBOOST_LIBRARYDIR="/opt/homebrew/opt/boost/lib" -DBoost_USE_STATIC_LIBS=OFF
-DBoost_USE_STATIC_RUNTIME=OFF -S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

Expand Down
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
# License for the specific language governing permissions and limitations under
# the License.

cmake_minimum_required(VERSION 3.15.0)
cmake_minimum_required(VERSION 3.21.0)
project(spotify-json)

# Set policy for CMP0144 to enable upper-case BOOST_ROOT usage
if (POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif()

# Set policy for CMP0167 to rely on BoostConfig.cmake rather than FindBoost
if (POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -174,9 +184,9 @@ target_link_libraries(${json_library_TARGET} double-conversion)

option(SPOTIFY_JSON_BUILD_TESTS "Build tests and benchmarks" ON)
if(SPOTIFY_JSON_BUILD_TESTS)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
# set(Boost_USE_MULTITHREADED ON)
# set(Boost_USE_STATIC_LIBS ON)
# set(Boost_USE_STATIC_RUNTIME ON)

find_package(Boost COMPONENTS chrono unit_test_framework system)

Expand Down

0 comments on commit 3fcbcf4

Please sign in to comment.