Fix a build bug.
This commit is contained in:
parent
0d8a07bbcc
commit
fac9558524
19
Makefile
19
Makefile
|
@ -1,32 +1,21 @@
|
||||||
gmock:
|
gmock:
|
||||||
$(MAKE) -C external/gtest all
|
$(MAKE) -C external/gtest all
|
||||||
|
|
||||||
gmock_clean:
|
gmock_clean:
|
||||||
$(MAKE) -C external/gtest clean
|
$(MAKE) -C external/gtest clean
|
||||||
|
|
||||||
cmake:
|
cmake:
|
||||||
$(MAKE) -C build/cmake all
|
$(MAKE) -C build/cmake all
|
||||||
|
|
||||||
cmake_clean:
|
cmake_clean:
|
||||||
$(MAKE) -C build/cmake clean
|
$(MAKE) -C build/cmake clean
|
||||||
|
|
||||||
prepare:
|
|
||||||
@if [ -d ".git" ]; then \
|
|
||||||
echo "source code exist"; \
|
|
||||||
else \
|
|
||||||
echo "source code not exist"; \
|
|
||||||
git init; \
|
|
||||||
git remote add origin https://gitee.com/shenzhen-jiuyilian/ipc.git; \
|
|
||||||
rm Makefile; \
|
|
||||||
git pull origin master; \
|
|
||||||
fi
|
|
||||||
@if [ -n "$(shell git status -s)" ]; then \
|
|
||||||
echo "source code changed."; \
|
|
||||||
else \
|
|
||||||
echo "source code do not changed."; \
|
|
||||||
fi
|
|
||||||
clean_code:
|
clean_code:
|
||||||
@rm -rf !(Makefile)
|
@rm -rf !(Makefile)
|
||||||
|
|
||||||
all:cmake
|
all:cmake
|
||||||
$(MAKE) -C cmake-shell all
|
$(MAKE) -C cmake-shell all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@if [ -d "cmake-shell" ]; then \
|
@if [ -d "cmake-shell" ]; then \
|
||||||
echo "cmake-shell exist"; \
|
echo "cmake-shell exist"; \
|
||||||
|
|
|
@ -27,7 +27,7 @@ aux_source_directory(./src SRC_FILES)
|
||||||
set(TARGET_NAME IpcConfig)
|
set(TARGET_NAME IpcConfig)
|
||||||
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
|
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME} Config StatusCode Log)
|
target_link_libraries(${TARGET_NAME} ConfigBase StatusCode Log)
|
||||||
|
|
||||||
if ("${CLANG_TIDY_SUPPORT}" MATCHES "true")
|
if ("${CLANG_TIDY_SUPPORT}" MATCHES "true")
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
|
|
|
@ -31,7 +31,7 @@ aux_source_directory(./src SRC_FILES)
|
||||||
|
|
||||||
set(TARGET_NAME ConfigTest)
|
set(TARGET_NAME ConfigTest)
|
||||||
add_executable(${TARGET_NAME} ${SRC_FILES})
|
add_executable(${TARGET_NAME} ${SRC_FILES})
|
||||||
target_link_libraries(${TARGET_NAME} Config gtest gmock pthread)
|
target_link_libraries(${TARGET_NAME} ConfigBase gtest gmock pthread)
|
||||||
if(${TEST_COVERAGE} MATCHES "true")
|
if(${TEST_COVERAGE} MATCHES "true")
|
||||||
target_link_libraries(${TARGET_NAME} gcov)
|
target_link_libraries(${TARGET_NAME} gcov)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -19,7 +19,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
aux_source_directory(./src SRC_FILES)
|
aux_source_directory(./src SRC_FILES)
|
||||||
|
|
||||||
set(TARGET_NAME Config)
|
set(TARGET_NAME ConfigBase)
|
||||||
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
|
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
|
||||||
target_link_libraries(${TARGET_NAME} StatusCode Log config)
|
target_link_libraries(${TARGET_NAME} StatusCode Log config)
|
||||||
|
|
||||||
|
@ -52,14 +52,15 @@ add_custom_command(
|
||||||
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig
|
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig
|
||||||
)
|
)
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
compile_libconfig
|
config
|
||||||
DEPENDS ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a
|
DEPENDS ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a
|
||||||
)
|
)
|
||||||
add_custom_command(
|
|
||||||
TARGET ${TARGET_NAME}
|
# add_custom_command(
|
||||||
PRE_BUILD
|
# TARGET ${TARGET_NAME}
|
||||||
COMMAND make compile_libconfig
|
# PRE_BUILD
|
||||||
WORKING_DIRECTORY ${PROJECT_ROOT_PATH}/cmake-shell
|
# COMMAND make compile_libconfig
|
||||||
)
|
# WORKING_DIRECTORY ${PROJECT_ROOT_PATH}/cmake-shell
|
||||||
|
# )
|
||||||
|
|
||||||
define_file_name(${TARGET_NAME})
|
define_file_name(${TARGET_NAME})
|
Loading…
Reference in New Issue
Block a user