Skip to content

Commit 7139727

Browse files
Internal-Compiler-Errorglynos
authored andcommitted
Improve cross platform compliance (#32)
* Add missing `Skyr_DISABLE_LIBCXX` option deceleration in top level CMakeLists.txt The option deceleration is missing, yet it is used for setting up the `stdlib=stdc++` flag for clang. Cmake option has the default value of `OFF`; the value is negated in the if statement so by default the flag is appended regardless of whether the machine has `stdc++` installed. Since some Clang installations do not come with `stdc++`, the project cannot be built. The default value is set to `ON` since LLVM's implementation of C++17 is not yet complete. More can be found in the links below: - [cppreference](https://en.cppreference.com/w/cpp/compiler_support) - [libc++ on 17](https://libcxx.llvm.org/cxx1z_status.html) - [libc++ homepage](https://libcxx.llvm.org/index.html) * Improve standard compliance By default if `CMAKE_CXX_EXTENSIONS` and `CMAKE_CXX_STANDARD_REQUIRED` are not set, cmake would allow non-standard C++ extensions. For instance it would pass `-std=gnu++17` instead of `-std=c++17` to GCC.
1 parent a198433 commit 7139727

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ option(Skyr_WARNINGS_AS_ERRORS "Treat warnings as errors." ON)
1515
option(Skyr_BUILD_WITHOUT_EXCEPTIONS "Build without exceptions." OFF)
1616
option(Skyr_USE_STATIC_CRT "Use static C Runtime library (/MT or MTd)." ON)
1717
option(Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS "Build the filesystem path functions" OFF)
18+
option(Skyr_DISABLE_LIBCXX "Instruct Clang to use LLVM's implementation of C++ standard library" ON)
1819

1920
set(CMAKE_VERBOSE_MAKEFILE true)
2021
set(CMAKE_CXX_STANDARD 17)
22+
set(CMAKE_CXX_EXTENSIONS OFF)
23+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2124

2225
find_package(Threads REQUIRED)
2326
find_package(tl-expected CONFIG REQUIRED)

0 commit comments

Comments
 (0)