diff options
author | Daniel Hahler <git@thequod.de> | 2019-07-07 13:01:38 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-07 13:01:38 +0200 |
commit | eb2509aef9faa428112b5da0f4e5730962def7af (patch) | |
tree | b1c645dfde9e88251652a0428a666c9c9c41c582 | |
parent | 1b99aa8c53ec3f1e9b8480758ca430aa5c36ed19 (diff) | |
download | rneovim-eb2509aef9faa428112b5da0f4e5730962def7af.tar.gz rneovim-eb2509aef9faa428112b5da0f4e5730962def7af.tar.bz2 rneovim-eb2509aef9faa428112b5da0f4e5730962def7af.zip |
build: fix GetCompileFlags for CMake #10444
Ref: https://github.com/neovim/neovim/pull/10363#issuecomment-508916959
-rw-r--r-- | cmake/GetCompileFlags.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmake/GetCompileFlags.cmake b/cmake/GetCompileFlags.cmake index 77a5260780..482eacca16 100644 --- a/cmake/GetCompileFlags.cmake +++ b/cmake/GetCompileFlags.cmake @@ -1,6 +1,6 @@ function(get_compile_flags _compile_flags) # Create template akin to CMAKE_C_COMPILE_OBJECT. - set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <COMPILE_OPTIONS> <COMPILE_DEFINITIONS> <INCLUDES>") + set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <COMPILE_OPTIONS><COMPILE_DEFINITIONS> <INCLUDES>") # Get C compiler. string(REPLACE @@ -13,9 +13,11 @@ function(get_compile_flags _compile_flags) get_directory_property(compile_definitions DIRECTORY "src/nvim" COMPILE_DEFINITIONS) - # NOTE: list(JOIN) requires CMake 3.12. + # NOTE: list(JOIN) requires CMake 3.12, string(CONCAT) requires CMake 3. string(REPLACE ";" " -D" compile_definitions "${compile_definitions}") - string(CONCAT compile_definitions "-D" "${compile_definitions}") + if(compile_definitions) + set(compile_definitions " -D${compile_definitions}") + endif() string(REPLACE "<COMPILE_DEFINITIONS>" "${compile_definitions}" |