mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
Merge pull request #1604 from equalsraf/tb-env-configs
Don't use env vars for configuration time options.
This commit is contained in:
commit
d5741e5124
@ -25,12 +25,10 @@ symbolizer=/usr/local/clang-$clang_version/bin/llvm-symbolizer
|
||||
|
||||
setup_prebuilt_deps x64
|
||||
|
||||
export SANITIZE=1
|
||||
export ASAN_SYMBOLIZER_PATH=$symbolizer
|
||||
export ASAN_OPTIONS="detect_leaks=1:log_path=$tmpdir/asan"
|
||||
export TSAN_OPTIONS="external_symbolizer_path=$symbolizer:log_path=$tmpdir/tsan"
|
||||
|
||||
export SKIP_UNITTEST=1
|
||||
export UBSAN_OPTIONS="log_path=$tmpdir/ubsan" # not sure if this works
|
||||
|
||||
CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
|
||||
@ -38,7 +36,7 @@ CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
|
||||
-DBUSTED_OUTPUT_TYPE=plainTerminal"
|
||||
|
||||
# Build and output version info.
|
||||
$MAKE_CMD CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" nvim
|
||||
$MAKE_CMD CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DSANITIZE=ON" nvim
|
||||
build/bin/nvim --version
|
||||
|
||||
# Run functional tests.
|
||||
|
@ -1,5 +1,11 @@
|
||||
include(CheckLibraryExists)
|
||||
|
||||
option(SANITIZE "Enable Clang sanitizers for nvim binary" OFF)
|
||||
if(SANITIZE AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
message(WARNING "SANITIZE is only supported for Clang ... disabling")
|
||||
set(SANITIZE OFF)
|
||||
endif()
|
||||
|
||||
set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto)
|
||||
set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua)
|
||||
file(GLOB API_HEADERS api/*.h)
|
||||
@ -94,25 +100,15 @@ endforeach()
|
||||
set_source_files_properties(
|
||||
${CONV_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion")
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(DEFINED ENV{SANITIZE})
|
||||
message(STATUS "Enabling the sanitizers")
|
||||
add_definitions(-DEXITFREE) # is this necessary for LeakSanitizer?
|
||||
add_definitions(-fno-sanitize-recover -fno-omit-frame-pointer
|
||||
-fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined)
|
||||
set(CMAKE_EXE_LINKER_FLAGS
|
||||
"-fsanitize=address -fsanitize=undefined ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS
|
||||
"-fsanitize=address -fsanitize=undefined ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_directory_property(gen_cdefs COMPILE_DEFINITIONS)
|
||||
foreach(gen_cdef ${gen_cdefs} DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
|
||||
if(NOT "${gen_cdef}" MATCHES "INCLUDE_GENERATED_DECLARATIONS")
|
||||
list(APPEND gen_cflags "-D${gen_cdef}")
|
||||
endif()
|
||||
endforeach()
|
||||
if (SANITIZE)
|
||||
list(APPEND gen_cflags "-DEXITFREE")
|
||||
endif()
|
||||
|
||||
get_directory_property(gen_includes INCLUDE_DIRECTORIES)
|
||||
foreach(gen_include ${gen_includes})
|
||||
@ -200,17 +196,20 @@ 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)
|
||||
add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES}
|
||||
${NEOVIM_HEADERS})
|
||||
target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
|
||||
install_helper(TARGETS nvim)
|
||||
|
||||
if(SANITIZE)
|
||||
message(STATUS "Enabling Clang sanitizers for nvim")
|
||||
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ")
|
||||
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fno-sanitize-recover -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined ")
|
||||
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=address -fsanitize=undefined ")
|
||||
endif()
|
||||
|
||||
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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user