all: require C++17

This commit is contained in:
Markus F.X.J. Oberhumer
2023-01-03 15:11:11 +01:00
parent 811b15a5b3
commit 72f3e9b25a
5 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ jobs:
set s=%H%\src set s=%H%\src
cat .GITREV.txt cat .GITREV.txt
set /p GITREV=<.GITREV.txt set /p GITREV=<.GITREV.txt
cl -MT -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -I%H%\vendor -Feupx.exe %s%\*.cpp %s%\util\*.cpp %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link setargv.obj cl -std:c++17 -Zc:__cplusplus -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -I%H%\vendor -Feupx.exe %s%\*.cpp %s%\util\*.cpp %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link setargv.obj
- name: 'Make artifact' - name: 'Make artifact'
shell: bash shell: bash
run: | run: |
+4 -4
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR) cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
# compilation config options # compilation config options
if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git") if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
@@ -110,8 +110,8 @@ set_property(TARGET upx_vendor_zlib PROPERTY C_STANDARD 11)
file(GLOB upx_SOURCES "src/*.cpp" "src/util/*.cpp") file(GLOB upx_SOURCES "src/*.cpp" "src/util/*.cpp")
list(SORT upx_SOURCES) list(SORT upx_SOURCES)
add_executable(upx ${upx_SOURCES}) add_executable(upx ${upx_SOURCES})
#target_compile_features(upx PRIVATE cxx_std_14) #target_compile_features(upx PRIVATE cxx_std_17)
set_property(TARGET upx PROPERTY CXX_STANDARD 14) set_property(TARGET upx PROPERTY CXX_STANDARD 17)
target_link_libraries(upx upx_vendor_ucl upx_vendor_zlib) target_link_libraries(upx upx_vendor_ucl upx_vendor_zlib)
if(UPX_CONFIG_DISABLE_WERROR) if(UPX_CONFIG_DISABLE_WERROR)
@@ -190,7 +190,7 @@ if(GITREV_SHORT)
endif() endif()
upx_sanitize_target(${t}) upx_sanitize_target(${t})
if(MSVC) if(MSVC)
target_compile_options(${t} PRIVATE -EHsc -J -W4 ${warn_WX}) target_compile_options(${t} PRIVATE -Zc:__cplusplus -EHsc -J -W4 ${warn_WX})
else() else()
target_compile_options(${t} PRIVATE target_compile_options(${t} PRIVATE
-Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith
+2
View File
@@ -129,3 +129,5 @@ endif
ifeq ($(wildcard ./vendor/zlib/crc32.c),) ifeq ($(wildcard ./vendor/zlib/crc32.c),)
$(error ERROR: missing git submodule; run 'git submodule update --init') $(error ERROR: missing git submodule; run 'git submodule update --init')
endif endif
.NOTPARALLEL: # top-level Makefile is sequential, but actual builds use "cmake --parallel"
+1
View File
@@ -1,3 +1,4 @@
-std=gnu++17
-Ivendor -Ivendor
-fno-strict-aliasing -fno-strict-aliasing
-fno-strict-overflow -fno-strict-overflow
+2 -6
View File
@@ -29,12 +29,8 @@
#ifndef UPX_CONF_H__ #ifndef UPX_CONF_H__
#define UPX_CONF_H__ 1 #define UPX_CONF_H__ 1
#if defined(__cplusplus) #if !(__cplusplus+0 >= 201703L)
# if (__cplusplus >= 201402L) # error "C++ 17 is required"
# elif defined(_MSC_VER) && defined(_MSVC_LANG) && (_MSVC_LANG+0 >= 201402L)
# else
# error "C++ 14 is required"
# endif
#endif #endif
#include "version.h" #include "version.h"