mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
40 lines
1.1 KiB
CMake
Executable File
40 lines
1.1 KiB
CMake
Executable File
project(test-ipc)
|
|
|
|
if (MSVC AND USE_STATIC_CRT)
|
|
set(CompilerFlags
|
|
CMAKE_CXX_FLAGS
|
|
CMAKE_CXX_FLAGS_DEBUG
|
|
CMAKE_CXX_FLAGS_RELEASE
|
|
CMAKE_C_FLAGS
|
|
CMAKE_C_FLAGS_DEBUG
|
|
CMAKE_C_FLAGS_RELEASE
|
|
)
|
|
foreach(CompilerFlag ${CompilerFlags})
|
|
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
|
endforeach()
|
|
endif()
|
|
|
|
if(NOT MSVC)
|
|
add_compile_options(
|
|
-Wno-attributes
|
|
-Wno-missing-field-initializers
|
|
-Wno-unused-variable
|
|
-Wno-unused-function)
|
|
endif()
|
|
|
|
include_directories(
|
|
${LIBIPC_PROJECT_DIR}/include
|
|
${LIBIPC_PROJECT_DIR}/src
|
|
${LIBIPC_PROJECT_DIR}/test
|
|
${LIBIPC_PROJECT_DIR}/3rdparty
|
|
${LIBIPC_PROJECT_DIR}/3rdparty/gtest/include)
|
|
|
|
file(GLOB SRC_FILES ${LIBIPC_PROJECT_DIR}/test/*.cpp)
|
|
file(GLOB HEAD_FILES ${LIBIPC_PROJECT_DIR}/test/*.h)
|
|
|
|
add_executable(${PROJECT_NAME} ${SRC_FILES} ${HEAD_FILES})
|
|
|
|
link_directories(${LIBIPC_PROJECT_DIR}/3rdparty/gperftools)
|
|
target_link_libraries(${PROJECT_NAME} gtest gtest_main ipc)
|
|
#target_link_libraries(${PROJECT_NAME} tcmalloc_minimal)
|