1
0
mirror of https://github.com/upx/upx.git synced 2025-08-07 22:46:51 +08:00

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

View File

@ -286,7 +286,7 @@ jobs:
set s=%H%\src
cat .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'
shell: bash
run: |

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
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")
list(SORT upx_SOURCES)
add_executable(upx ${upx_SOURCES})
#target_compile_features(upx PRIVATE cxx_std_14)
set_property(TARGET upx PROPERTY CXX_STANDARD 14)
#target_compile_features(upx PRIVATE cxx_std_17)
set_property(TARGET upx PROPERTY CXX_STANDARD 17)
target_link_libraries(upx upx_vendor_ucl upx_vendor_zlib)
if(UPX_CONFIG_DISABLE_WERROR)
@ -190,7 +190,7 @@ if(GITREV_SHORT)
endif()
upx_sanitize_target(${t})
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()
target_compile_options(${t} PRIVATE
-Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith

View File

@ -129,3 +129,5 @@ endif
ifeq ($(wildcard ./vendor/zlib/crc32.c),)
$(error ERROR: missing git submodule; run 'git submodule update --init')
endif
.NOTPARALLEL: # top-level Makefile is sequential, but actual builds use "cmake --parallel"

View File

@ -1,3 +1,4 @@
-std=gnu++17
-Ivendor
-fno-strict-aliasing
-fno-strict-overflow

View File

@ -29,12 +29,8 @@
#ifndef UPX_CONF_H__
#define UPX_CONF_H__ 1
#if defined(__cplusplus)
# if (__cplusplus >= 201402L)
# elif defined(_MSC_VER) && defined(_MSVC_LANG) && (_MSVC_LANG+0 >= 201402L)
# else
# error "C++ 14 is required"
# endif
#if !(__cplusplus+0 >= 201703L)
# error "C++ 17 is required"
#endif
#include "version.h"