Skip to content

Commit

Permalink
Use c++14 for windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Aug 12, 2024
1 parent 7c17b71 commit d4d5ba1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ jobs:
cd build
-DBoost_INCLUDE_DIR=${{steps.install-boost.outputs.BOOST_ROOT}}/include\
-DBoost_LIBRARY_DIRS=${{steps.install-boost.outputs.BOOST_ROOT}}/lib
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS=--target=x86_64-pc-windows-gnu -DCMAKE_CXX_FLAGS=--target=x86_64-pc-windows-gnu -DCMAKE_MAKE_PROGRAM=mingw32-make ..
cmake -G "MinGW Makefiles" \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS=--target=x86_64-pc-windows-gnu \
-DCMAKE_CXX_FLAGS=--target=x86_64-pc-windows-gnu \
-DCMAKE_MAKE_PROGRAM=mingw32-make \
-DIQTREE_FLAGS="c++14" ..
make -j
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#
# nozlib: do not use zlib
# libcxx
#
# c++14: use C++14 standard (default is C++17)

# CMAPLE: Integrate CMAPLE library
#---------------
Expand Down Expand Up @@ -249,7 +251,7 @@ set(CLANG "FALSE") # Clang compiler
set(ICC "FALSE") # Intel compiler
set(VCC "FALSE") # MS Visual C Compiler, note that it is different from MSVC variable
set(CLANG_UNDER_VS "FALSE") #Clang compiler, used from inside Visual Studio
# using C++17 standard
# using C++17 standard (unless IQTREE_FLAGS specifies c++14, required for compilation using mingw in Github actions)
# disable AVX for NEON
if (__ARM_NEON)
set(IQTREE_FLAGS "${IQTREE_FLAGS} novx")
Expand All @@ -258,6 +260,8 @@ elseif (CMAKE_CXX_COMPILER MATCHES "VISUAL STUDIO")
#it won't recognize the -std=c++17 parameter.
#Todo: don't hard-code this; figure out some way it can be passed in (though ideally, not the whole shebang).
include_directories("C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\lib\\clang\\10.0.0\\include")
elseif(IQTREE_FLAGS MATCHES "c++14")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
endif()
Expand Down

0 comments on commit d4d5ba1

Please sign in to comment.