Skip to content

JayTwoLab/conan-msvc-linux_gcc-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Conan ํ”„๋กœ์ ํŠธ ๋นŒ๋“œ ๋ช…๋ น

์‚ฌ์ „ ์„ค์น˜ ํ•ญ๋ชฉ

  • Windows : Visual Studio (2022 or higher) , cmake, ninja
  • Linux : gcc (g++) , cmake, ninja

ํ”„๋กœ์ ํŠธ ์„ค์ •

  • conanfile.txt ํŒŒ์ผ ์ƒ์„ฑ
[requires]
boost/1.84.0

[options]
boost/*:shared=False

[generators]
CMakeToolchain
CMakeDeps
  • ์œ„์˜ ๊ฒฝ์šฐ boost ๋ฒ„์ „ 1.84.0 ์„ ์‚ฌ์šฉ

Visual Studio 2022

  • ์ฝ”๋‚œ ํ”„๋กœํ•„ ํŒŒ์ผ์„ ์‚ฌ์ „์— ์ƒ์„ฑํ•œ๋‹ค.

  • ๋ฆด๋ฆฌ์ฆˆ ๋นŒ๋“œ๋ฅผ ์œ„ํ•œ ์„ค์ • ํŒŒ์ผ ์ƒ์„ฑ: C:\Users\<user>\.conan2\profiles\msvc_release (<user>๋Š” ๊ฐœ์ธ ๊ณ„์ •)
[settings]
os=Windows
arch=x86_64
build_type=Release
compiler=msvc
compiler.version=194
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.cppstd=17

[conf]
tools.cmake.cmaketoolchain:generator=Ninja
  • compiler.version
    • Visual Studio ๋ฒ„์ „+ ์ œํ’ˆ ๋ฒ„์ „(MSVC Toolset), Conan compiler.version
      • Visual Studio 2026, 195
      • Visual Studio 2022 17.10~, 194
      • Visual Studio 2022 17.0~17.9, 193
      • Visual Studio 2019, 192
      • Visual Studio 2017, 191
      • Visual Studio 2015, 190
      • cl ๋ช…๋ น์„ ์ž…๋ ฅํ•˜๋ฉด ํ‘œ์‹œ๋˜๋Š” ๋ฒ„์ „์˜ ์ƒ์œ„ 3์ž๋ฆฌ ๊ฐ’: ์˜ˆ> 19.50.35725 ์ด๋ฉด 195 ๋ฅผ ์‚ฌ์šฉ

  • ๋””๋ฒ„๊น… ๋นŒ๋“œ๋ฅผ ์œ„ํ•œ ์„ค์ • ํŒŒ์ผ ์ƒ์„ฑ: C:\Users\<user>\.conan2\profiles\msvc_debug
[settings]
os=Windows
arch=x86_64
build_type=Debug
compiler=msvc
compiler.version=194
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.cppstd=17

[conf]
tools.cmake.cmaketoolchain:generator=Ninja


  • Visual Studio์ธ ๊ฒฝ์šฐ Release ๋นŒ๋“œ ์ ˆ์ฐจ
# msvc cmd ์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ช…๋ น๋“ค์„ ์‹คํ–‰ํ•œ๋‹ค. 

cmake -E rm -rf build-msvc-release
# build-msvc ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์กด์žฌ ์—ฌ๋ถ€์™€ ๊ด€๊ณ„์—†์ด, ํ•˜์œ„ ๋‚ด์šฉ๊นŒ์ง€ ์ „๋ถ€ ์‚ญ์ œ

conan install . ^
 -pr:h %USERPROFILE%\.conan2\profiles\msvc_release ^
 -pr:b default ^
 -of build-msvc-release ^
 --build=missing
# conan install . : ํ˜„์žฌ ๋””๋ ‰ํ„ฐ๋ฆฌ(.)์— ์žˆ๋Š” conanfile.txt ๋˜๋Š” conanfile.py๋ฅผ ๊ธฐ์ค€
# -pr:h %USERPROFILE%\.conan2\profiles\msvc_release : host profile ์ง€์ •
# -pr:b default : ๋ณดํ†ต host์™€ ๋™์ผํ•˜๋ฉด default๋ฅผ ์‚ฌ์šฉ
# -of build-msvc-release : Conan์ด ์ƒ์„ฑํ•˜๋Š” ํŒŒ์ผ๋“ค์„ build-msvc-release ๋””๋ ‰ํ„ฐ๋ฆฌ์— ์ถœ๋ ฅ  
# --build=missing : ๋กœ์ปฌ ์บ์‹œ์— ์—†๋Š” ํŒจํ‚ค์ง€๋Š” ์†Œ์Šค์—์„œ ๋นŒ๋“œ. ์ด๋ฏธ ์บ์‹œ์— ์žˆ์œผ๋ฉด ๋นŒ๋“œํ•˜์ง€ ์•Š์Œ. 

cmake -S . ^
 -B build-msvc-release ^
 -DCMAKE_TOOLCHAIN_FILE=build-msvc\conan_toolchain.cmake ^
 -G "Visual Studio 17 2022"
# -S . : ํ˜„์žฌ ๋””๋ ‰ํ„ฐ๋ฆฌ(.)์— CMakeLists.txt๊ฐ€ ์žˆ์Œ
# -B build-msvc : CMake ๊ฒฐ๊ณผ๋ฌผ์„ build-msvc์— ์ƒ์„ฑ
# -DCMAKE_TOOLCHAIN_FILE=build-msvc\conan_toolchain.cmake : 

cmake --build build-msvc-release --config Release
# --build build-msvc-release : build-msvc-release ๊ฒฝ๋กœ ๋นŒ๋“œ
# --config Release : ํ”„๋กœํ•„ ํŒŒ์ผ(msvc_release)์— Release๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ, ๋ฆด๋ฆฌ์ฆˆ๋กœ ๋นŒ๋“œํ•˜์—ฌ์•ผ ํ•จ.

  • Visual Studio์ธ ๊ฒฝ์šฐ Debug ๋นŒ๋“œ ์ ˆ์ฐจ
cmake -E rm -rf build-msvc-debug

conan install . ^
  -pr:h %USERPROFILE%\.conan2\profiles\msvc_debug ^
  -pr:b default ^
  -of build-msvc-debug ^
  --build=missing

cmake -S . -B build-msvc-debug ^
  -DCMAKE_TOOLCHAIN_FILE=build-msvc-debug\conan_toolchain.cmake ^
  -G "Visual Studio 17 2022"

cmake --build build-msvc-debug --config Debug


Rocky Linux 8 x86_64

  • ๋ฆด๋ฆฌ์ฆˆ ๋นŒ๋“œ๋ฅผ ์œ„ํ•œ ์„ค์ • ํŒŒ์ผ ์ƒ์„ฑ: /home/<user>/.conan2/profiles/linux_gcc_release
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++11
build_type=Release

[conf]
tools.cmake.cmaketoolchain:generator=Ninja

  • gcc/linux ์—์„œ Release ๋นŒ๋“œ
cmake -E rm -rf build-linux-gcc-release

conan install . \
 -pr:h ~/.conan2/profiles/linux_gcc_release \
 -pr:b default \
 -of build-linux-gcc-release \
 --build=b2* \
 --build=missing
# b2์˜ ์ข…์†์„ฑ ๋ฌธ์ œ๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ๋ฅผ ๋Œ€๋น„ํ•˜์—ฌ b2๋„ ๋นŒ๋“œํ•จ

cmake -S . \
 -B build-linux-gcc-release \
 -DCMAKE_TOOLCHAIN_FILE=build-linux-gcc/conan_toolchain.cmake \
 -G "Unix Makefiles" \
 -DCMAKE_BUILD_TYPE=Release

cmake --build build-linux-gcc-release --config Release

About

๐Ÿ“ฆ conan ๋นŒ๋“œ (Visual Studio 2022, Rocky Linux 8)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors