mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 01:06:45 +08:00
add cmake support
This commit is contained in:
parent
2941007301
commit
9edad35713
@ -17,6 +17,9 @@ matrix:
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||
- compiler: clang
|
||||
- compiler: clang
|
||||
env:
|
||||
- MATRIX_EVAL="USING_CMAKE=1"
|
||||
|
||||
before_install:
|
||||
- eval "${MATRIX_EVAL}"
|
||||
@ -24,7 +27,7 @@ before_install:
|
||||
script:
|
||||
- qmake -v
|
||||
- cd ./build
|
||||
- qmake -o Makefile src.pro QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX
|
||||
- if [ $USING_CMAKE -eq 1 ]; then cmake CMakeLists.txt; else qmake -o Makefile ipc.pro QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX; fi
|
||||
- qmake -o MakefileTest test.pro QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX
|
||||
- make
|
||||
- make -f MakefileTest
|
||||
|
||||
22
build/CMakeLists.txt
Normal file
22
build/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(ipc)
|
||||
|
||||
add_compile_definitions(__IPC_LIBRARY__)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_compile_options("-std=gnu++1z")
|
||||
else()
|
||||
add_compile_options("/std:c++17")
|
||||
endif()
|
||||
|
||||
include_directories("../include")
|
||||
include_directories("../src")
|
||||
|
||||
if(UNIX)
|
||||
file(GLOB DIR_SRCS ../src/platform/*_linux.cpp)
|
||||
else()
|
||||
file(GLOB DIR_SRCS ../src/platform/*_win.cpp)
|
||||
endif()
|
||||
aux_source_directory(../src DIR_SRCS)
|
||||
|
||||
add_library(ipc SHARED ${DIR_SRCS})
|
||||
set(LIBRARY_OUTPUT_PATH ../output)
|
||||
Loading…
x
Reference in New Issue
Block a user