Fix a build bug.
This commit is contained in:
parent
0d8a07bbcc
commit
fac9558524
19
Makefile
19
Makefile
|
@ -1,32 +1,21 @@
|
|||
gmock:
|
||||
$(MAKE) -C external/gtest all
|
||||
|
||||
gmock_clean:
|
||||
$(MAKE) -C external/gtest clean
|
||||
|
||||
cmake:
|
||||
$(MAKE) -C build/cmake all
|
||||
|
||||
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:
|
||||
@rm -rf !(Makefile)
|
||||
|
||||
all:cmake
|
||||
$(MAKE) -C cmake-shell all
|
||||
|
||||
clean:
|
||||
@if [ -d "cmake-shell" ]; then \
|
||||
echo "cmake-shell exist"; \
|
||||
|
|
|
@ -27,7 +27,7 @@ aux_source_directory(./src SRC_FILES)
|
|||
set(TARGET_NAME IpcConfig)
|
||||
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")
|
||||
add_custom_target(
|
||||
|
|
|
@ -31,7 +31,7 @@ aux_source_directory(./src SRC_FILES)
|
|||
|
||||
set(TARGET_NAME ConfigTest)
|
||||
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")
|
||||
target_link_libraries(${TARGET_NAME} gcov)
|
||||
endif()
|
||||
|
|
|
@ -19,7 +19,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|||
|
||||
aux_source_directory(./src SRC_FILES)
|
||||
|
||||
set(TARGET_NAME Config)
|
||||
set(TARGET_NAME ConfigBase)
|
||||
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
|
||||
target_link_libraries(${TARGET_NAME} StatusCode Log config)
|
||||
|
||||
|
@ -52,14 +52,15 @@ add_custom_command(
|
|||
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig
|
||||
)
|
||||
add_custom_target(
|
||||
compile_libconfig
|
||||
config
|
||||
DEPENDS ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET ${TARGET_NAME}
|
||||
PRE_BUILD
|
||||
COMMAND make compile_libconfig
|
||||
WORKING_DIRECTORY ${PROJECT_ROOT_PATH}/cmake-shell
|
||||
)
|
||||
|
||||
# add_custom_command(
|
||||
# TARGET ${TARGET_NAME}
|
||||
# PRE_BUILD
|
||||
# COMMAND make compile_libconfig
|
||||
# WORKING_DIRECTORY ${PROJECT_ROOT_PATH}/cmake-shell
|
||||
# )
|
||||
|
||||
define_file_name(${TARGET_NAME})
|
Loading…
Reference in New Issue
Block a user