freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] gsoc-2022-chariri-final 74e60eab 1/6: [ftinspect] Upda


From: Werner Lemberg
Subject: [freetype2-demos] gsoc-2022-chariri-final 74e60eab 1/6: [ftinspect] Update build system settings.
Date: Fri, 2 Sep 2022 01:19:24 -0400 (EDT)

branch: gsoc-2022-chariri-final
commit 74e60eabcd85ce4562b768a2dd799118ea85556c
Author: Charlie Jiang <w@chariri.moe>
Commit: Charlie Jiang <w@chariri.moe>

    [ftinspect] Update build system settings.
    
    * src/ftinspect/CMakeLists.txt: Fix MSVC-only options. Require Qt 5.15 and
      enable higher warning level.
    
    * src/ftinspect/meson.build: Set C++ version. Require Qt 5.15.
---
 src/ftinspect/CMakeLists.txt | 14 ++++++++++++--
 src/ftinspect/meson.build    |  4 +++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/ftinspect/CMakeLists.txt b/src/ftinspect/CMakeLists.txt
index c910e055..fc730937 100644
--- a/src/ftinspect/CMakeLists.txt
+++ b/src/ftinspect/CMakeLists.txt
@@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD 11)
 
 project("ftinspect")
 
-if (WIN32)
+if (MSVC)
   add_compile_options("/utf-8")
 endif ()
 
@@ -12,7 +12,7 @@ set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTORCC ON)
 set(CMAKE_AUTOUIC ON)
 
-find_package(Qt5 COMPONENTS Widgets REQUIRED)
+find_package(Qt5 5.15 COMPONENTS Widgets REQUIRED)
 find_package(Freetype REQUIRED)
 
 add_executable(ftinspect
@@ -36,3 +36,13 @@ target_link_libraries(ftinspect
   Qt5::Core Qt5::Widgets
   Freetype::Freetype
 )
+
+# Fix for CMake prior to 3.15
+string(REGEX REPLACE "/W[3|4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+if(MSVC)
+  target_compile_options(ftinspect PRIVATE "/W4" "/wd4100")
+else(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
+     OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+  target_compile_options(ftinspect PRIVATE "-Wall" "-Wextra" 
+                         "-Wpedantic" "-Wno-unused-parameter")
+endif()
diff --git a/src/ftinspect/meson.build b/src/ftinspect/meson.build
index 9d2abbd4..39019774 100644
--- a/src/ftinspect/meson.build
+++ b/src/ftinspect/meson.build
@@ -14,7 +14,8 @@
 qt5 = import('qt5')
 qt5_dep = dependency('qt5',
   required: false,
-  modules: ['Core', 'Gui', 'Widgets'])
+  modules: ['Core', 'Gui', 'Widgets'],
+  version : '>=5.15')
 
 # Don't compile `ftinspect` if Qt5 is not found.  This can happen
 # when cross-compiling to a different system.
@@ -48,6 +49,7 @@ if qt5_dep.found()
     sources,
     moc_files,
     dependencies: [qt5_dep, libfreetype2_dep],
+    override_options : ['cpp_std=c++11'],
     install: true)
 endif
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]