mirror of
https://github.com/Kitware/CMake.git
synced 2025-06-11 00:23:40 +08:00

#pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#pragma once
|
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
|
|
|
#include <string>
|
|
|
|
#include "cm_sys_stat.h"
|
|
|
|
namespace cmFSPermissions {
|
|
|
|
// Table of permissions flags.
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
static const mode_t mode_owner_read = S_IREAD;
|
|
static const mode_t mode_owner_write = S_IWRITE;
|
|
static const mode_t mode_owner_execute = S_IEXEC;
|
|
static const mode_t mode_group_read = 040;
|
|
static const mode_t mode_group_write = 020;
|
|
static const mode_t mode_group_execute = 010;
|
|
static const mode_t mode_world_read = 04;
|
|
static const mode_t mode_world_write = 02;
|
|
static const mode_t mode_world_execute = 01;
|
|
static const mode_t mode_setuid = 04000;
|
|
static const mode_t mode_setgid = 02000;
|
|
#else
|
|
static const mode_t mode_owner_read = S_IRUSR;
|
|
static const mode_t mode_owner_write = S_IWUSR;
|
|
static const mode_t mode_owner_execute = S_IXUSR;
|
|
static const mode_t mode_group_read = S_IRGRP;
|
|
static const mode_t mode_group_write = S_IWGRP;
|
|
static const mode_t mode_group_execute = S_IXGRP;
|
|
static const mode_t mode_world_read = S_IROTH;
|
|
static const mode_t mode_world_write = S_IWOTH;
|
|
static const mode_t mode_world_execute = S_IXOTH;
|
|
static const mode_t mode_setuid = S_ISUID;
|
|
static const mode_t mode_setgid = S_ISGID;
|
|
#endif
|
|
|
|
bool stringToModeT(std::string const& arg, mode_t& permissions);
|
|
|
|
} // ns
|