mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
add cmake support
This commit is contained in:
parent
2941007301
commit
9edad35713
@ -17,6 +17,9 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||||
- compiler: clang
|
- compiler: clang
|
||||||
|
- compiler: clang
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="USING_CMAKE=1"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- eval "${MATRIX_EVAL}"
|
- eval "${MATRIX_EVAL}"
|
||||||
@ -24,7 +27,7 @@ before_install:
|
|||||||
script:
|
script:
|
||||||
- qmake -v
|
- qmake -v
|
||||||
- cd ./build
|
- 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
|
- qmake -o MakefileTest test.pro QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX
|
||||||
- make
|
- make
|
||||||
- make -f MakefileTest
|
- 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