Skip to content
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

[build] Fixed Linux build with STDCXX SYNC enabled #1445

Merged
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
23 changes: 23 additions & 0 deletions .github/workflows/cxx11-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: cxx11_win

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: macos-cxx11
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: configure
run: |
mkdir _build && cd _build
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_ENCRYPTION=OFF -DENABLE_UNITTESTS=ON
- name: build
run: cd _build && cmake --build ./
- name: test
run: cd _build && ctest --extra-verbose
23 changes: 23 additions & 0 deletions .github/workflows/cxx11-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: cxx11_win

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: ubuntu-cxx11
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- name: configure
run: |
mkdir _build && cd _build
cmake ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_UNITTESTS=ON
- name: build
run: cd _build && cmake --build ./
- name: test
run: cd _build && ctest --extra-verbose
1 change: 1 addition & 0 deletions .github/workflows/cxx11-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build:

name: windows-cxx11
runs-on: windows-latest

steps:
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Intel|Clang|AppleClang")
# At the bottom there's information about C++98, which is default up to 6.1 version.
# For all other compilers - including Clang - we state that the default C++ standard is AT LEAST 11.
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 6.1)
message(STATUS "NOTE: GCC ${CMAKE_CXX_COMPILER_VERSION} is detected with default C++98. Forcing C++11 on applications.")
message(STATUS "NOTE: GCC ${CMAKE_CXX_COMPILER_VERSION} is detected with default C++98. Forcing C++11 on applications.")
set (FORCE_CXX_STANDARD 1)
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang|AppleClang")
message(STATUS "NOTE: CLANG ${CMAKE_CXX_COMPILER_VERSION} detected, unsure if >=C++11 is default, forcing C++11 on applications")
set (FORCE_CXX_STANDARD 1)
else()
message(STATUS "NOTE: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} - assuming default C++11.")
message(STATUS "NOTE: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} - assuming default C++11.")
endif()
else()
message(STATUS "COMPILER: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) - NOT GNU compat")
Expand Down Expand Up @@ -629,7 +629,8 @@ if (ENABLE_CODE_COVERAGE)
endif()
endif()

if (ENABLE_STDCXX_SYNC)
# On Linux pthreads have to be linked even when using C++11 threads
if (ENABLE_STDCXX_SYNC AND NOT LINUX)
message(STATUS "Pthread library: C++11")
elseif (PTHREAD_LIBRARY AND PTHREAD_INCLUDE_DIR)
message(STATUS "Pthread library: ${PTHREAD_LIBRARY}")
Expand Down