mirror of
https://github.com/dragonflydb/dragonfly
synced 2024-11-21 23:19:53 +00:00
fix: make --help flag work for development builds (#2004)
Before that SOURCE_PATH_FROM_BUILD_ENV define has not been defined for the development builds. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
17e331c16c
commit
2876a9ecab
@ -4,10 +4,11 @@ cxx_link(dragonfly base dragonfly_lib)
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
# Add core2 only to this file, thus avoiding instructions in this object file that
|
||||
# can cause SIGILL.
|
||||
set_source_files_properties(dfly_main.cc PROPERTIES COMPILE_FLAGS -march=core2 COMPILE_DEFINITIONS
|
||||
SOURCE_PATH_FROM_BUILD_ENV=${CMAKE_SOURCE_DIR})
|
||||
set_source_files_properties(dfly_main.cc PROPERTIES COMPILE_FLAGS -march=core2)
|
||||
endif()
|
||||
|
||||
set_property(SOURCE dfly_main.cc APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
SOURCE_PATH_FROM_BUILD_ENV=${CMAKE_SOURCE_DIR})
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
SET(TX_LINUX_SRCS io_mgr.cc tiered_storage.cc)
|
||||
|
@ -46,13 +46,6 @@
|
||||
#include "util/http/http_client.h"
|
||||
#include "util/varz.h"
|
||||
|
||||
#define STRING_PP_NX(A) #A
|
||||
#define STRING_MAKE_PP(A) STRING_PP_NX(A)
|
||||
|
||||
// This would create a string value from a "defined" location of the source code
|
||||
// Note that SOURCE_PATH_FROM_BUILD_ENV is taken from the build system
|
||||
#define BUILD_LOCATION_PATH STRING_MAKE_PP(SOURCE_PATH_FROM_BUILD_ENV)
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <crt_externs.h>
|
||||
#define environ (*_NSGetEnviron())
|
||||
@ -313,6 +306,13 @@ bool HelpFlags(std::string_view f) {
|
||||
return absl::StartsWith(f, "\033[0;3");
|
||||
}
|
||||
|
||||
#define STRING_PP_NX(A) #A
|
||||
#define STRING_MAKE_PP(A) STRING_PP_NX(A)
|
||||
|
||||
// This would create a string value from a "defined" location of the source code
|
||||
// Note that SOURCE_PATH_FROM_BUILD_ENV is taken from the build system
|
||||
#define BUILD_LOCATION_PATH STRING_MAKE_PP(SOURCE_PATH_FROM_BUILD_ENV)
|
||||
|
||||
string NormalizePaths(std::string_view path) {
|
||||
const std::string FULL_PATH = BUILD_LOCATION_PATH;
|
||||
const std::string FULL_PATH_SRC = FULL_PATH + "/src";
|
||||
|
Loading…
Reference in New Issue
Block a user