mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 11:35:38 -04:00
CMakeLists.txt: Set policy CMP0151. (introduced in CMake-3.27)
clang complains about namespace pollution in generated moc_*.cpp files: In file included from src/kde/kf5/kfilemetadata_rom-properties-kf5_autogen/mocs_compilation.cpp:2: src/kde/kf5/kfilemetadata_rom-properties-kf5_autogen/BKZOEHIFDQ/moc_ExtractorPluginKF5.cpp:1082:17: warning: using namespace directive in global context in header [-Wheader-hygiene] 1082 | using namespace RomPropertiesKF5; | ^ Setting CMP0151 tells AUTOGEN to add the include paths using -isystem, which tells clang it shouldn't print warnings about these files.
This commit is contained in:
parent
47296cfc9d
commit
1f8dc86386
@ -3,12 +3,29 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
|
||||
|
||||
# CMP0048: Set VERSION variables based on the project version specified in PROJECT().
|
||||
# Introduced in CMake 3.0.
|
||||
CMAKE_POLICY(SET CMP0048 NEW)
|
||||
IF(POLICY CMP0048)
|
||||
CMAKE_POLICY(SET CMP0048 NEW)
|
||||
ENDIF(CMP0048)
|
||||
|
||||
# CMP0063: Honor visibility properties for all target types,
|
||||
# including static libraries and executables.
|
||||
# Introduced in CMake 3.3.
|
||||
CMAKE_POLICY(SET CMP0063 NEW)
|
||||
IF(POLICY CMP0063)
|
||||
CMAKE_POLICY(SET CMP0063 NEW)
|
||||
ENDIF(POLICY CMP0063)
|
||||
|
||||
# CMP0151: Use -isystem for AUTOMOC include directories.
|
||||
# clang complains about `using namespace` statements in the
|
||||
# generated moc_*.cpp files:
|
||||
# In file included from src/kde/kf5/kfilemetadata_rom-properties-kf5_autogen/mocs_compilation.cpp:2:
|
||||
# src/kde/kf5/kfilemetadata_rom-properties-kf5_autogen/BKZOEHIFDQ/moc_ExtractorPluginKF5.cpp:1082:17:
|
||||
# warning: using namespace directive in global context in header [-Wheader-hygiene]
|
||||
# 1082 | using namespace RomPropertiesKF5;
|
||||
# | ^
|
||||
# Introduced in CMake 3.27.
|
||||
IF(POLICY CMP0151)
|
||||
CMAKE_POLICY(SET CMP0151 NEW)
|
||||
ENDIF(POLICY CMP0151)
|
||||
|
||||
# Read the project version.
|
||||
CONFIGURE_FILE(version.txt version.txt.tmp)
|
||||
|
Loading…
Reference in New Issue
Block a user