Martchus / cpp-utilities

Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
GNU General Public License v2.0
52 stars 18 forks source link

Fix building on Mac OS X/macOS #15

Closed yan12125 closed 5 years ago

yan12125 commented 5 years ago

Without project(), compiler flags like -std=gnu++17 are not applied for non-Apple clang on Mac OS X/macOS.

For a more detailed explanation, see the commit message for a similar case - https://github.com/macports/macports-ports/commit/98445d69fc13be9c968abe4c597de8324b0ceee6.

Also, according to CMake document [1]:

The top-level CMakeLists.txt file for a project must contain a literal, direct call to the project() command; loading one through the include() command is not sufficient.

That explains why the project() command in cmake/modules/BasicConfig.cmake does not always work.

[1] https://cmake.org/cmake/help/latest/command/project.html#command:project

yan12125 commented 5 years ago

Thanks fixed!