aboutsummaryrefslogtreecommitdiff
path: root/cmake/GetCompileFlags.cmake
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:40:31 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:40:31 +0000
commit339e2d15cc26fe86988ea06468d912a46c8d6f29 (patch)
treea6167fc8fcfc6ae2dc102f57b2473858eac34063 /cmake/GetCompileFlags.cmake
parent067dc73729267c0262438a6fdd66e586f8496946 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.gz
rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.bz2
rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.zip
Merge remote-tracking branch 'upstream/master' into fix_repeatcmdline
Diffstat (limited to 'cmake/GetCompileFlags.cmake')
-rw-r--r--cmake/GetCompileFlags.cmake57
1 files changed, 0 insertions, 57 deletions
diff --git a/cmake/GetCompileFlags.cmake b/cmake/GetCompileFlags.cmake
deleted file mode 100644
index 9b3c053871..0000000000
--- a/cmake/GetCompileFlags.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-function(get_compile_flags _compile_flags)
- string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
- set(compile_flags ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${build_type}})
-
- # Get flags set by target_compile_options().
- get_target_property(opt main_lib INTERFACE_COMPILE_OPTIONS)
- if(opt)
- list(APPEND compile_flags ${opt})
- endif()
-
- get_target_property(opt nvim COMPILE_OPTIONS)
- if(opt)
- list(APPEND compile_flags ${opt})
- endif()
-
- # Get flags set by target_compile_definitions().
- get_target_property(defs main_lib INTERFACE_COMPILE_DEFINITIONS)
- if(defs)
- foreach(def ${defs})
- list(APPEND compile_flags "-D${def}")
- endforeach()
- endif()
-
- get_target_property(defs nvim COMPILE_DEFINITIONS)
- if(defs)
- foreach(def ${defs})
- list(APPEND compile_flags "-D${def}")
- endforeach()
- endif()
-
- # Get include directories.
- get_target_property(dirs main_lib INTERFACE_INCLUDE_DIRECTORIES)
- if(dirs)
- foreach(dir ${dirs})
- list(APPEND compile_flags "-I${dir}")
- endforeach()
- endif()
-
- get_target_property(dirs main_lib INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
- if(dirs)
- foreach(dir ${dirs})
- list(APPEND compile_flags "-I${dir}")
- endforeach()
- endif()
-
- get_target_property(dirs nvim INCLUDE_DIRECTORIES)
- if(dirs)
- foreach(dir ${dirs})
- list(APPEND compile_flags "-I${dir}")
- endforeach()
- endif()
-
- list(REMOVE_DUPLICATES compile_flags)
- string(REPLACE ";" " " compile_flags "${compile_flags}")
-
- set(${_compile_flags} "${compile_flags}" PARENT_SCOPE)
-endfunction()