aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/common.cmake
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2019-12-21 11:45:33 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2019-12-21 11:45:33 +0300
commit878307974b777b951488c61b73d903b4a06c484c (patch)
tree7e9cc0b4ff7b6697be0f6a575ae7800e0a72c68f /common.cmake
parentcommon.cmake: rename some internal variables (diff)
downloadcmake-common-878307974b777b951488c61b73d903b4a06c484c.tar.gz
cmake-common-878307974b777b951488c61b73d903b4a06c484c.zip
common.cmake: rename internal functions
Diffstat (limited to 'common.cmake')
-rw-r--r--common.cmake42
1 files changed, 21 insertions, 21 deletions
diff --git a/common.cmake b/common.cmake
index e5af0db..9a31acc 100644
--- a/common.cmake
+++ b/common.cmake
@@ -88,7 +88,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Common compiler options routines:
-function(best_practices_msvc target)
+function(_cc_best_practices_msvc target)
set(compile_options /MP /W4)
get_target_property(target_type "${target}" TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
@@ -96,7 +96,7 @@ function(best_practices_msvc target)
endif()
endfunction()
-function(best_practices_gcc target)
+function(_cc_best_practices_gcc target)
set(compile_options -Wall -Wextra)
get_target_property(target_type "${target}" TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
@@ -104,17 +104,17 @@ function(best_practices_gcc target)
endif()
endfunction()
-function(best_practices target)
+function(_cc_best_practices target)
if(is_msvc)
- best_practices_msvc("${target}")
+ _cc_best_practices_msvc("${target}")
elseif(is_gcc)
- best_practices_gcc("${target}")
+ _cc_best_practices_gcc("${target}")
endif()
endfunction()
# Useful Windows macros routines:
-function(enable_windows_def target)
+function(_cc_common_windows_definitions target)
set(compile_definitions WIN32_LEAN_AND_MEAN NOMINMAX)
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL "INTERFACE_LIBRARY")
@@ -126,7 +126,7 @@ endfunction()
# Static runtime routines:
-function(static_runtime_msvc target)
+function(_cc_static_runtime_msvc target)
get_target_property(target_type "${target}" TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
target_compile_options("${target}" PRIVATE
@@ -135,24 +135,24 @@ function(static_runtime_msvc target)
endif()
endfunction()
-function(static_runtime_gcc target)
+function(_cc_static_runtime_gcc target)
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL "EXECUTABLE")
target_link_libraries("${target}" PRIVATE -static)
endif()
endfunction()
-function(static_runtime target)
+function(_cc_static_runtime target)
if(is_msvc)
- static_runtime_msvc("${target}")
+ _cc_static_runtime_msvc("${target}")
elseif(is_gcc)
- static_runtime_gcc("${target}")
+ _cc_static_runtime_gcc("${target}")
endif()
endfunction()
# Symbol stripping routines:
-function(strip_symbols_gcc target)
+function(_cc_strip_symbols_gcc target)
get_target_property(target_type "${target}" TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(release_build $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>)
@@ -160,29 +160,29 @@ function(strip_symbols_gcc target)
endif()
endfunction()
-function(strip_symbols target)
+function(_cc_strip_symbols target)
if(is_gcc)
- strip_symbols_gcc("${target}")
+ _cc_strip_symbols_gcc("${target}")
endif()
endfunction()
# Main macros:
-function(apply_common_settings target)
+function(_cc_apply_settings target)
if(TARGET "${target}")
get_target_property(target_imported "${target}" IMPORTED)
if(NOT target_imported)
if(CC_BEST_PRACTICES)
- best_practices("${target}")
+ _cc_best_practices("${target}")
endif()
if(CC_WINDOWS_DEF)
- enable_windows_def("${target}")
+ _cc_common_windows_definitions("${target}")
endif()
if(CC_STRIP_SYMBOLS)
- strip_symbols("${target}")
+ _cc_strip_symbols("${target}")
endif()
if(CC_STATIC_RUNTIME)
- static_runtime("${target}")
+ _cc_static_runtime("${target}")
endif()
endif()
endif()
@@ -190,10 +190,10 @@ endfunction()
macro(add_executable target)
_add_executable(${ARGV})
- apply_common_settings("${target}")
+ _cc_apply_settings("${target}")
endmacro()
macro(add_library target)
_add_library(${ARGV})
- apply_common_settings("${target}")
+ _cc_apply_settings("${target}")
endmacro()