aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDundar Goc <gocdundar@gmail.com>2022-06-22 20:06:15 +0200
committerDundar Goc <gocdundar@gmail.com>2022-08-03 09:52:05 +0200
commit6e2c6114f991b3b61887fd9d1b442623b4b03882 (patch)
treec8ac2b7d7a19ea58b11ed6fec7952328ab168ac4 /src
parentcc1ceebf8f13aed1ec0cbe0ff1ad7b2d8a6f10be (diff)
downloadrneovim-6e2c6114f991b3b61887fd9d1b442623b4b03882.tar.gz
rneovim-6e2c6114f991b3b61887fd9d1b442623b4b03882.tar.bz2
rneovim-6e2c6114f991b3b61887fd9d1b442623b4b03882.zip
build: replace deprecated cmake features with their modern alternatives
- Use DIRECTORY instead of PATH in get_filename_component - Use COMPILE_OPTIONS instead of COMPILE_FLAGS. COMPILE_FLAGS is treated as a single string while COMPILE_OPTIONS is a list, meaning that cmake will take care of any escaping and quoting automatically.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/nvim/CMakeLists.txt14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 017883a913..65af69c539 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -225,7 +225,7 @@ foreach(sfile ${NVIM_SOURCES}
"${GENERATED_KEYSETS}"
"${GENERATED_UI_EVENTS_CLIENT}"
)
- get_filename_component(full_d ${sfile} PATH)
+ get_filename_component(full_d ${sfile} DIRECTORY)
file(RELATIVE_PATH d "${CMAKE_CURRENT_LIST_DIR}" "${full_d}")
if(${d} MATCHES "^[.][.]|auto/")
file(RELATIVE_PATH d "${GENERATED_DIR}" "${full_d}")
@@ -597,10 +597,7 @@ set_target_properties(
POSITION_INDEPENDENT_CODE ON
OUTPUT_NAME ${LIBNVIM_NAME}
)
-set_property(
- TARGET libnvim
- APPEND_STRING PROPERTY COMPILE_FLAGS " -DMAKE_LIB "
-)
+target_compile_options(libnvim PRIVATE -DMAKE_LIB)
if(NOT LUAJIT_FOUND)
message(STATUS "luajit not found, skipping nvim-test (unit tests) target")
@@ -626,10 +623,7 @@ else()
PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
- set_property(
- TARGET nvim-test
- APPEND_STRING PROPERTY COMPILE_FLAGS " -DUNIT_TESTING "
- )
+ target_compile_options(nvim-test PRIVATE -DUNIT_TESTING)
endif()
if(CLANG_ASAN_UBSAN)
@@ -664,7 +658,7 @@ elseif(CLANG_TSAN)
endif()
function(get_test_target prefix sfile relative_path_var target_var)
- get_filename_component(full_d "${sfile}" PATH)
+ get_filename_component(full_d "${sfile}" DIRECTORY)
file(RELATIVE_PATH d "${PROJECT_SOURCE_DIR}/src/nvim" "${full_d}")
if(d MATCHES "^[.][.]")
file(RELATIVE_PATH d "${GENERATED_DIR}" "${full_d}")