mirror of
https://github.com/GerbilSoft/zlib-ng.git
synced 2025-06-19 03:55:39 -04:00
Added fallback macros for add_compile_options and add_link_options.
This commit is contained in:
parent
24291edbd6
commit
8927b8553d
@ -51,6 +51,7 @@ include(cmake/detect-install-dirs.cmake)
|
|||||||
include(cmake/detect-coverage.cmake)
|
include(cmake/detect-coverage.cmake)
|
||||||
include(cmake/detect-intrinsics.cmake)
|
include(cmake/detect-intrinsics.cmake)
|
||||||
include(cmake/detect-sanitizer.cmake)
|
include(cmake/detect-sanitizer.cmake)
|
||||||
|
include(cmake/fallback-macros.cmake)
|
||||||
|
|
||||||
if(CMAKE_TOOLCHAIN_FILE)
|
if(CMAKE_TOOLCHAIN_FILE)
|
||||||
message(STATUS "Using CMake toolchain: ${CMAKE_TOOLCHAIN_FILE}")
|
message(STATUS "Using CMake toolchain: ${CMAKE_TOOLCHAIN_FILE}")
|
||||||
|
19
cmake/fallback-macros.cmake
Normal file
19
cmake/fallback-macros.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# fallback-macros.cmake -- CMake fallback macros
|
||||||
|
# Copyright (C) 2022 Nathan Moinvaziri
|
||||||
|
# Licensed under the Zlib license, see LICENSE.md for details
|
||||||
|
|
||||||
|
# CMake less than version 3.5.2
|
||||||
|
if(NOT COMMAND add_compile_options)
|
||||||
|
macro(add_compile_options options)
|
||||||
|
string(APPEND CMAKE_C_FLAGS ${options})
|
||||||
|
string(APPEND CMAKE_CXX_FLAGS ${options})
|
||||||
|
endmacro()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# CMake less than version 3.14
|
||||||
|
if(NOT COMMAND add_link_options)
|
||||||
|
macro(add_link_options options)
|
||||||
|
string(APPEND CMAKE_EXE_LINKER_FLAGS ${options})
|
||||||
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS ${options})
|
||||||
|
endmacro()
|
||||||
|
endif()
|
Loading…
Reference in New Issue
Block a user