Skip to content

Fix MSVC-2019 GitHub Actions CI #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
fail-fast: false
max-parallel: 20
matrix:
compiler: [msvc-2019]
compiler: [msvc-2019, msvc-2017]
base-flags: ["", -DJINJA2CPP_CXX_STANDARD=17]
build-config: [Release, Debug]
build-platform: [x86, x64]
build-runtime: [/MT]
build-shared: [FALSE]
build-runtime: ["", /MT, /MD]
build-shared: [FALSE, TRUE]

include:
- compiler: msvc-2017
Expand Down Expand Up @@ -66,13 +66,9 @@ jobs:
VC_VARS: "${{ matrix.vc_vars }}"
run: |
call "%VC_VARS%"
set BOOST_ROOT=%BOOST_ROOT_1_69_0%
set path=%BOOST_ROOT%\lib;%PATH%
echo "###########1 " %BOOST_ROOT%
echo "###########2 " %PATH%
mkdir -p .build
cd .build
cmake .. -G "%INPUT_GENERATOR%" -DCMAKE_BUILD_TYPE=%INPUT_BUILD_CONFIG% -DJINJA2CPP_MSVC_RUNTIME_TYPE="%INPUT_BUILD_RUNTIME%" -DJINJA2CPP_DEPS_MODE=external-boost -DJINJA2CPP_BUILD_SHARED=%INPUT_BUILD_SHARED% -DJINJA2CPP_VERBOSE=ON -DBoost_DEBUG=ON -DBOOST_ROOT=%BOOST_ROOT_1_69_0% %INPUT_BASE_FLAGS% %INPUT_EXTRA_FLAGS%
cmake .. -G "%INPUT_GENERATOR%" -DCMAKE_BUILD_TYPE=%INPUT_BUILD_CONFIG% -DJINJA2CPP_MSVC_RUNTIME_TYPE="%INPUT_BUILD_RUNTIME%" -DJINJA2CPP_DEPS_MODE=external-boost -DJINJA2CPP_BUILD_SHARED=%INPUT_BUILD_SHARED% %INPUT_BASE_FLAGS% %INPUT_EXTRA_FLAGS%
cmake --build . --config %INPUT_BUILD_CONFIG%

- name: Test
Expand All @@ -83,8 +79,5 @@ jobs:
run: |
cd .build
call "%VC_VARS%"
set BOOST_ROOT=%BOOST_ROOT_1_69_0%
set path=%BOOST_ROOT%\lib;%PATH%
echo "###########1 " %BOOST_ROOT%
echo "###########2 " %PATH%
ctest -C %INPUT_BUILD_CONFIG% -V
1 change: 1 addition & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if(MSVC)
set (THIRDPARTY_RUNTIME_TYPE "/MD")
endif()
endif ()
message(STATUS "Selected Jinja2C++ thirdparty libraries runtime type: '${THIRDPARTY_RUNTIME_TYPE}'")
endif ()

function(update_submodule submodule)
Expand Down
32 changes: 16 additions & 16 deletions thirdparty/external_boost_deps.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
if (JINJA2CPP_VERBOSE)
set (FIND_BOOST_PACKAGE_QUIET)
else ()
set (FIND_BOOST_PACKAGE_QUIET)
set (FIND_BOOST_PACKAGE_QUIET QUIET)
endif ()

if (MSVC)
if (NOT DEFINED Boost_USE_STATIC_LIBS)
if (THIRDPARTY_RUNTIME_TYPE STREQUAL "/MD" OR THIRDPARTY_RUNTIME_TYPE STREQUAL "/MDd")
set (Boost_USE_STATIC_LIBS OFF)
set (Boost_USE_STATIC_RUNTIME OFF)
else ()
set (Boost_USE_STATIC_LIBS ON)
set (Boost_USE_STATIC_RUNTIME ON)
endif ()
if (JINJA2CPP_VERBOSE)
message (STATUS ">>>DEBUG<<< Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
endif ()
endif ()
endif ()

find_package(boost_filesystem ${FIND_BOOST_PACKAGE_QUIET})
Expand All @@ -20,21 +35,6 @@ if(boost_filesystem_FOUND AND


else()
if (MSVC)
if (NOT DEFINED Boost_USE_STATIC_LIBS)
if (THIRDPARTY_RUNTIME_TYPE STREQUAL "/MD" OR THIRDPARTY_RUNTIME_TYPE STREQUAL "/MDd")
set (Boost_USE_STATIC_LIBS OFF)
set (Boost_USE_STATIC_RUNTIME OFF)
else ()
set (Boost_USE_STATIC_LIBS ON)
set (Boost_USE_STATIC_RUNTIME ON)
endif ()
if (JINJA2CPP_VERBOSE)
message (STATUS ">>>DEBUG<<< Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
endif ()
endif ()
endif ()

find_package(Boost COMPONENTS system filesystem ${FIND_BOOST_PACKAGE_QUIET} REQUIRED)

if (Boost_FOUND)
Expand Down