mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
cmake: Set expected C++ standard to C++17
This commit is contained in:
parent
3aa663908a
commit
3800584c2d
1 changed files with 12 additions and 10 deletions
|
@ -16,7 +16,7 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
# CMake Setup
|
# CMake Setup
|
||||||
CMake_Minimum_Required(VERSION 3.1.0)
|
CMake_Minimum_Required(VERSION 3.8.0)
|
||||||
Include("cmake/util.cmake")
|
Include("cmake/util.cmake")
|
||||||
|
|
||||||
# Automatic Versioning
|
# Automatic Versioning
|
||||||
|
@ -133,15 +133,9 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# C++ Standard and Extensions
|
# C++ Standard and Extensions
|
||||||
IF (CMAKE_VERSION VERSION_LESS "3.8")
|
## Use C++17 and no non-standard extensions.
|
||||||
SET(CMAKE_CXX_STANDARD 14)
|
SET(_CXX_STANDARD 17)
|
||||||
ELSEIF (CMAKE_VERSION VERSION_LESS "3.11")
|
SET(_CXX_EXTENSIONS OFF)
|
||||||
SET(CMAKE_CXX_STANDARD 17)
|
|
||||||
ELSE() # CMake 3.11 or higher:
|
|
||||||
SET(CMAKE_CXX_STANDARD 20)
|
|
||||||
ENDIF()
|
|
||||||
## Disable nonstandard extensions
|
|
||||||
SET(CMAKE_CXX_EXTENSIONS OFF)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Options
|
# Options
|
||||||
|
@ -472,6 +466,14 @@ if (WIN32)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# C++ Standard and Extensions
|
||||||
|
set_target_properties(
|
||||||
|
${PROJECT_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
CXX_STANDARD ${_CXX_STANDARD}
|
||||||
|
CXX_EXTENSIONS ${_CXX_EXTENSIONS}
|
||||||
|
)
|
||||||
|
|
||||||
# File Version
|
# File Version
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
|
|
Loading…
Reference in a new issue