Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid build warnings with more modern clang compilers
- Loading branch information
Showing
5 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2017 Gregor Klinke | ||
|
||
include(CheckCXXSourceCompiles) | ||
|
||
set(CMAKE_REQUIRED_FLAGS "${cxx11_options}") | ||
|
||
|
||
set(CMAKE_REQUIRED_FLAGS "${cxx11_options}") | ||
CHECK_CXX_SOURCE_COMPILES(" | ||
#include <codecvt> | ||
int main() { | ||
std::codecvt_utf8_utf16<char16_t> x; | ||
return 0; | ||
} | ||
" TEXTBOOK_HAVE_STD_CODECVT) | ||
|
||
|
||
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang | ||
OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) | ||
CHECK_CXX_COMPILER_FLAG("-Wno-shift-negative-value" | ||
TEXTBOOK_HAVE_WARNING_SHIFT_NEGATIVE_VALUE) | ||
|
||
CHECK_CXX_COMPILER_FLAG("-Wno-expansion-to-defined" | ||
TEXTBOOK_HAVE_WARNING_EXPANSION_TO_DEFINED) | ||
|
||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#cmakedefine HAVE_STD_CODECVT 1 | ||
#cmakedefine TEXTBOOK_HAVE_STD_CODECVT 1 | ||
#cmakedefine TEXTBOOK_HAVE_WARNING_SHIFT_NEGATIVE_VALUE | ||
#cmakedefine TEXTBOOK_HAVE_WARNING_EXPANSION_TO_DEFINED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters