Skip to content

Commit

Permalink
chore: Pass CMAKE_CXX_COMPILER to try_compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Tradias committed Apr 21, 2024
1 parent 4f6f615 commit 7f4e964
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
os: macos-13,
triplet: 'x64-osx-release',
build-type: 'Debug',
cmake-extra-args: '-DCMAKE_BUILD_TYPE=Debug -DVCPKG_TARGET_TRIPLET=x64-osx-release -DCMAKE_TRY_COMPILE_TARGET_TYPE=EXECUTABLE',
cmake-extra-args: '-DCMAKE_BUILD_TYPE=Debug -DVCPKG_TARGET_TRIPLET=x64-osx-release',
parallel: 4,
}

Expand All @@ -59,7 +59,7 @@ jobs:
run: ${{ env.VCPKG_ROOT }}/vcpkg install --recurse --clean-after-build --triplet ${{ matrix.config.triplet }} --host-triplet ${{ matrix.config.triplet }} --x-install-root=${{ runner.workspace }}/vcpkg_installed --overlay-ports=${{ github.workspace }}/deps --overlay-triplets=${{ github.workspace }}/.github/vcpkg

- name: Configure CMake
run: cmake --preset default --debug-trycompile -DVCPKG_INSTALLED_DIR=${{ runner.workspace }}/vcpkg_installed ${{ env.CMAKE_ARGS }} ${{ matrix.config.cmake-extra-args }}
run: cmake --preset default -DVCPKG_INSTALLED_DIR=${{ runner.workspace }}/vcpkg_installed ${{ env.CMAKE_ARGS }} ${{ matrix.config.cmake-extra-args }}

- name: Build
run: cmake --build --preset default --config ${{ matrix.config.build-type }} --parallel ${{ matrix.config.parallel }}
Expand Down
2 changes: 1 addition & 1 deletion cmake/AsioGrpcCheckBoostVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
try_compile(
ASIO_GRPC_BOOST_ASIO_HAS_CO_AWAIT "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/check_boost_asio_has_co_await.cpp"
CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
LINK_LIBRARIES Boost::headers CXX_STANDARD 20 CXX_STANDARD_REQUIRED on)

message(STATUS "ASIO_GRPC_BOOST_ASIO_HAS_CO_AWAIT: ${ASIO_GRPC_BOOST_ASIO_HAS_CO_AWAIT}")
3 changes: 2 additions & 1 deletion cmake/AsioGrpcCheckStdPmr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
try_compile(
ASIO_GRPC_HAS_STD_PMR "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_LIST_DIR}/check_std_pmr.cpp"
CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" CXX_STANDARD 17 CXX_STANDARD_REQUIRED on)
CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" CXX_STANDARD 17
CXX_STANDARD_REQUIRED on)

message(STATUS "ASIO_GRPC_HAS_STD_PMR: ${ASIO_GRPC_HAS_STD_PMR}")

0 comments on commit 7f4e964

Please sign in to comment.