Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用更现代化的依赖管理 #1

Open
qi7chen opened this issue May 27, 2021 · 1 comment
Open

使用更现代化的依赖管理 #1

qi7chen opened this issue May 27, 2021 · 1 comment

Comments

@qi7chen
Copy link

qi7chen commented May 27, 2021

C++的三方库依赖,可以使用conan或者vcpkg

例如conan的配置:

conan.txt

[requires]
protobuf/3.15.5
libevent/2.1.12
lz4/1.9.3
yaml-cpp/0.6.3

[generators]
cmake

然后cmake里面增加一点东西

CMakeList.txt

conan_basic_setup()
target_link_libraries(md5 ${CONAN_LIBS})

然后运行环境,我觉得给一个docker-compose.yml把mysql,redis加起来,比给一个shell脚本更友好

如:

docker-compose.yml

version: "3"

volumes:
    mysql-data:
    etcd-data:

services:
    etcd1:
        image: bitnami/etcd
        volumes:
            - etcd-data:/bitnami/etcd/data
        environment: 
            - ALLOW_NONE_AUTHENTICATION=yes
            - ETCD_NAME=etcd1
            - ETCD_ADVERTISE_CLIENT_URLS=http://etcd1:2379
        ports:
            - 12379:2379
            - 12380:2380

    redis:
        image: redis:6-alpine
        ports:
            - 16379:6379
    
    mysqldb:
        image: mysql:5.7
        command: --default-authentication-plugin=mysql_native_password
        volumes: 
            - ./etc/mysql:/etc/mysql/mysql.conf.d
            - mysql-data:/var/lib/mysql
        ports:
            - 13306:3306
        environment:
            MYSQL_ROOT_PASSWORD: LGrk4IaS0Wflxw
            MYSQL_DATABASE: gamedb
@wuqunyong
Copy link
Owner

恩,谢谢指点

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants