diff options
author | Rui Abreu Ferreira <raf-ep@gmx.com> | 2014-12-01 10:25:40 +0000 |
---|---|---|
committer | Rui Abreu Ferreira <raf-ep@gmx.com> | 2014-12-02 14:36:47 +0000 |
commit | 6e9af3c5dce22a0822f655b4d1ea05bac6f7232a (patch) | |
tree | 847a50d7212afac259fb3b9970bacbeb8bd3957c /src | |
parent | ecf1e672e11ec5a2d8cf97276405aca83f4d9786 (diff) | |
download | rneovim-6e9af3c5dce22a0822f655b4d1ea05bac6f7232a.tar.gz rneovim-6e9af3c5dce22a0822f655b4d1ea05bac6f7232a.tar.bz2 rneovim-6e9af3c5dce22a0822f655b4d1ea05bac6f7232a.zip |
Don't use env vars for configuration time options
- As a general rule of thumb one shouldn't use environment variables
for setting configuration options for CMake. The reason for this is
we don't know when CMake will be executed and re-evaluate that variable.
- e.g. If we run cmake a first time with a var set, and then run make on
a second session (with no var) and cmake is called because a
dependency changed, the option would be disabled
- This commit removes the use of environment vars from
src/nvim/CMakeLists.txt entirely
- Removed SKIP_UNITTEST since it could only be used to remove a target
at configuration time (and the target was optional anyway)
- Turned SANITIZE into an option, clang-asan.sh now passes cmake
-DSANITIZE=ON
- Removed SKIP_EXEC since it was disabling a target at configuration time
(not being used)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/nvim/po/CMakeLists.txt | 3 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 184bcc0548..b0618fc69a 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -94,8 +94,9 @@ endforeach() set_source_files_properties( ${CONV_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion") +option(SANITIZE "Enable sanitizers when using Clang" OFF) if(CMAKE_C_COMPILER_ID MATCHES "Clang") - if(DEFINED ENV{SANITIZE}) + if(SANITIZE) message(STATUS "Enabling the sanitizers") add_definitions(-DEXITFREE) # is this necessary for LeakSanitizer? add_definitions(-fno-sanitize-recover -fno-omit-frame-pointer @@ -197,17 +198,13 @@ list(APPEND NVIM_LINK_LIBRARIES m ${CMAKE_THREAD_LIBS_INIT}) -if(NOT DEFINED ENV{SKIP_EXEC}) - add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} - ${NEOVIM_HEADERS}) - target_link_libraries(nvim ${NVIM_LINK_LIBRARIES}) - install_helper(TARGETS nvim) -endif() +add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} + ${NEOVIM_HEADERS}) +target_link_libraries(nvim ${NVIM_LINK_LIBRARIES}) +install_helper(TARGETS nvim) -if(NOT DEFINED ENV{SKIP_UNITTEST}) - add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_SOURCES} +add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} ${NEOVIM_HEADERS}) - target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES}) -endif() +target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES}) add_subdirectory(po) diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt index 6a56e302e9..443f3c6595 100644 --- a/src/nvim/po/CMakeLists.txt +++ b/src/nvim/po/CMakeLists.txt @@ -2,8 +2,7 @@ find_package(Gettext) find_program(XGETTEXT_PRG xgettext) find_program(ICONV_PRG iconv) -if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG AND - NOT DEFINED ENV{SKIP_EXEC}) +if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG) set(ENV{OLD_PO_FILE_INPUT} yes) set(ENV{OLD_PO_FILE_OUTPUT} yes) |