Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba committed Jun 3, 2024
1 parent 211b1cb commit 60bd69b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMake/build-from-src.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function(build_from_src [dep])
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND ./configure --prefix=${BINARY_DIR}
BUILD_COMMAND sh -c "V=1 CFLAGS=\"-fPIC -O3 -Wall -Wextra -fno-stack-protector\" $(MAKE) -C src"
# INSTALL_COMMAND $(MAKE) install
INSTALL_COMMAND $(MAKE) install
)
set(URING_INCLUDE_DIRS ${BINARY_DIR}/include PARENT_SCOPE)
set(URING_LIBRARIES ${BINARY_DIR}/lib/liburing.a PARENT_SCOPE)
Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,20 @@ endif ()

# Build test cases
if (PHOTON_BUILD_TESTING)
include_directories(photon_static ${GFLAGS_INCLUDE_DIRS} ${GOOGLETEST_INCLUDE_DIRS})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/examples-output)
link_libraries(${GFLAGS_LIBRARIES})
add_subdirectory(examples)

include(CTest)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/output)
include(generate-ctest-packed-script)

add_library(ci-tools STATIC test/ci-tools.cpp)
target_include_directories(ci-tools PRIVATE include)

include_directories(photon_static ${GFLAGS_INCLUDE_DIRS} ${GOOGLETEST_INCLUDE_DIRS})
link_libraries(${GFLAGS_LIBRARIES} ${GOOGLETEST_LIBRARIES} ci-tools)

add_subdirectory(examples)
add_subdirectory(common/checksum/test)
add_subdirectory(common/test)
add_subdirectory(common/memory-stream/test)
Expand Down
12 changes: 6 additions & 6 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
add_definitions(-w)

add_executable(simple-example simple/simple.cpp)
target_link_libraries(simple-example PRIVATE photon_shared)
target_link_libraries(simple-example PRIVATE photon_static)

add_executable(net-perf perf/net-perf.cpp)
target_link_libraries(net-perf PRIVATE photon_shared)
target_link_libraries(net-perf PRIVATE photon_static)

add_executable(rpc-example-client rpc/client.cpp rpc/client_main.cpp)
target_link_libraries(rpc-example-client PRIVATE photon_shared)
target_link_libraries(rpc-example-client PRIVATE photon_static)

add_executable(rpc-example-server rpc/server.cpp rpc/server_main.cpp)
target_link_libraries(rpc-example-server PRIVATE photon_shared)
target_link_libraries(rpc-example-server PRIVATE photon_static)

add_executable(sync-primitive sync-primitive/sync-primitive.cpp)
target_link_libraries(sync-primitive PRIVATE photon_shared)
target_link_libraries(sync-primitive PRIVATE photon_static)

if (ENABLE_FSTACK_DPDK)
add_executable(fstack-dpdk-demo fstack-dpdk/fstack-dpdk-demo.cpp)
target_link_libraries(fstack-dpdk-demo PRIVATE fstack_dpdk photon_shared)
target_link_libraries(fstack-dpdk-demo PRIVATE fstack_dpdk photon_static)
endif ()

0 comments on commit 60bd69b

Please sign in to comment.