Merge pull request #1392 from fwalch/fix-build-warnings

Fix build warnings.
This commit is contained in:
John Szakmeister 2014-11-05 06:46:49 -05:00
commit d1675de0a9
3 changed files with 13 additions and 9 deletions

View File

@ -15,7 +15,7 @@ list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR})
# Version tokens # Version tokens
include(GetGitRevisionDescription) include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT) get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
if (NOT NVIM_VERSION_COMMIT) if(NOT NVIM_VERSION_COMMIT)
set(NVIM_VERSION_COMMIT "?") set(NVIM_VERSION_COMMIT "?")
endif() endif()
set(NVIM_VERSION_MAJOR 0) set(NVIM_VERSION_MAJOR 0)
@ -25,7 +25,7 @@ set(NVIM_VERSION_PRERELEASE "-alpha")
# TODO(justinmk): UTC time would be nice here #1071 # TODO(justinmk): UTC time would be nice here #1071
git_timestamp(GIT_TIMESTAMP) git_timestamp(GIT_TIMESTAMP)
# TODO(justinmk): do not set this for "release" builds #1071 # TODO(justinmk): do not set this for "release" builds #1071
if (GIT_TIMESTAMP) if(GIT_TIMESTAMP)
set(NVIM_VERSION_BUILD "+${GIT_TIMESTAMP}") set(NVIM_VERSION_BUILD "+${GIT_TIMESTAMP}")
endif() endif()
@ -45,7 +45,8 @@ endif()
# gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently # gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently
# does not work with Neovim due to some uses of dynamically-sized structures. # does not work with Neovim due to some uses of dynamically-sized structures.
# See https://github.com/neovim/neovim/issues/223 for details. # See https://github.com/neovim/neovim/issues/223 for details.
if(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "4") if(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "4"
AND CMAKE_BUILD_TYPE MATCHES "^Rel")
# -U in add_definitions doesn't end up in the correct spot, so we add it to # -U in add_definitions doesn't end up in the correct spot, so we add it to
# the flags variable instead. # the flags variable instead.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
@ -248,7 +249,7 @@ if(BUSTED_PRG)
-P ${CMAKE_MODULE_PATH}/RunTests.cmake -P ${CMAKE_MODULE_PATH}/RunTests.cmake
DEPENDS nvim-test unittest-headers) DEPENDS nvim-test unittest-headers)
add_custom_target(test add_custom_target(functionaltest
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG} -DBUSTED_PRG=${BUSTED_PRG}
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
@ -257,5 +258,5 @@ if(BUSTED_PRG)
-DBUILD_DIR=${CMAKE_BINARY_DIR} -DBUILD_DIR=${CMAKE_BINARY_DIR}
-DTEST_TYPE=functional -DTEST_TYPE=functional
-P ${CMAKE_MODULE_PATH}/RunTests.cmake -P ${CMAKE_MODULE_PATH}/RunTests.cmake
DEPENDS nvim) DEPENDS nvim)
endif() endif()

View File

@ -77,8 +77,10 @@ endif
oldtest: | nvim oldtest: | nvim
+$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES) +$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES)
test: | nvim functionaltest: | nvim
+$(BUILD_CMD) -C build test +$(BUILD_CMD) -C build functionaltest
test: functionaltest
unittest: | nvim unittest: | nvim
+$(BUILD_CMD) -C build unittest +$(BUILD_CMD) -C build unittest
@ -93,4 +95,4 @@ distclean: clean
install: | nvim install: | nvim
+$(BUILD_CMD) -C build install +$(BUILD_CMD) -C build install
.PHONY: test unittest clean distclean nvim cmake deps install .PHONY: test functionaltest unittest clean distclean nvim cmake deps install

View File

@ -88,7 +88,8 @@ get_directory_property(gen_includes INCLUDE_DIRECTORIES)
foreach(gen_include ${gen_includes}) foreach(gen_include ${gen_includes})
set(gen_cflags "${gen_cflags} -I${gen_include}") set(gen_cflags "${gen_cflags} -I${gen_include}")
endforeach() endforeach()
set(gen_cflags "${gen_cflags} ${CMAKE_C_FLAGS}") string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
set(gen_cflags "${gen_cflags} ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}")
foreach(sfile ${NEOVIM_SOURCES} foreach(sfile ${NEOVIM_SOURCES}
"${PROJECT_SOURCE_DIR}/src/nvim/regexp_nfa.c") "${PROJECT_SOURCE_DIR}/src/nvim/regexp_nfa.c")