mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -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
|
setup_prebuilt_deps x64
|
||||||
|
|
||||||
export SANITIZE=1
|
|
||||||
export ASAN_SYMBOLIZER_PATH=$symbolizer
|
export ASAN_SYMBOLIZER_PATH=$symbolizer
|
||||||
export ASAN_OPTIONS="detect_leaks=1:log_path=$tmpdir/asan"
|
export ASAN_OPTIONS="detect_leaks=1:log_path=$tmpdir/asan"
|
||||||
export TSAN_OPTIONS="external_symbolizer_path=$symbolizer:log_path=$tmpdir/tsan"
|
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
|
export UBSAN_OPTIONS="log_path=$tmpdir/ubsan" # not sure if this works
|
||||||
|
|
||||||
CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
|
CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
|
||||||
@ -38,7 +36,7 @@ CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
|
|||||||
-DBUSTED_OUTPUT_TYPE=plainTerminal"
|
-DBUSTED_OUTPUT_TYPE=plainTerminal"
|
||||||
|
|
||||||
# Build and output version info.
|
# 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
|
build/bin/nvim --version
|
||||||
|
|
||||||
# Run functional tests.
|
# Run functional tests.
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
include(CheckLibraryExists)
|
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(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto)
|
||||||
set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua)
|
set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua)
|
||||||
file(GLOB API_HEADERS api/*.h)
|
file(GLOB API_HEADERS api/*.h)
|
||||||
@ -94,25 +100,15 @@ endforeach()
|
|||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
${CONV_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion")
|
${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)
|
get_directory_property(gen_cdefs COMPILE_DEFINITIONS)
|
||||||
foreach(gen_cdef ${gen_cdefs} DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
|
foreach(gen_cdef ${gen_cdefs} DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
|
||||||
if(NOT "${gen_cdef}" MATCHES "INCLUDE_GENERATED_DECLARATIONS")
|
if(NOT "${gen_cdef}" MATCHES "INCLUDE_GENERATED_DECLARATIONS")
|
||||||
list(APPEND gen_cflags "-D${gen_cdef}")
|
list(APPEND gen_cflags "-D${gen_cdef}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
if (SANITIZE)
|
||||||
|
list(APPEND gen_cflags "-DEXITFREE")
|
||||||
|
endif()
|
||||||
|
|
||||||
get_directory_property(gen_includes INCLUDE_DIRECTORIES)
|
get_directory_property(gen_includes INCLUDE_DIRECTORIES)
|
||||||
foreach(gen_include ${gen_includes})
|
foreach(gen_include ${gen_includes})
|
||||||
@ -200,17 +196,20 @@ list(APPEND NVIM_LINK_LIBRARIES
|
|||||||
m
|
m
|
||||||
${CMAKE_THREAD_LIBS_INIT})
|
${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
if(NOT DEFINED ENV{SKIP_EXEC})
|
add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES}
|
||||||
add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES}
|
${NEOVIM_HEADERS})
|
||||||
${NEOVIM_HEADERS})
|
target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
|
||||||
target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
|
install_helper(TARGETS nvim)
|
||||||
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()
|
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})
|
${NEOVIM_SOURCES} ${NEOVIM_HEADERS})
|
||||||
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
|
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(po)
|
add_subdirectory(po)
|
||||||
|
@ -2,8 +2,7 @@ find_package(Gettext)
|
|||||||
find_program(XGETTEXT_PRG xgettext)
|
find_program(XGETTEXT_PRG xgettext)
|
||||||
find_program(ICONV_PRG iconv)
|
find_program(ICONV_PRG iconv)
|
||||||
|
|
||||||
if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG AND
|
if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG)
|
||||||
NOT DEFINED ENV{SKIP_EXEC})
|
|
||||||
set(ENV{OLD_PO_FILE_INPUT} yes)
|
set(ENV{OLD_PO_FILE_INPUT} yes)
|
||||||
set(ENV{OLD_PO_FILE_OUTPUT} yes)
|
set(ENV{OLD_PO_FILE_OUTPUT} yes)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user