File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -39,31 +39,28 @@ if (-not (Test-Path $BUILD_DIR)) {
3939
4040# Step 4: Install dependencies with Conan
4141Write-Host " ${YELLOW} Installing dependencies with Conan...${NC} "
42- try {
43- conan install . -- output- folder= $BUILD_DIR -- build= missing
42+ if (conan install . -- output- folder= $BUILD_DIR -- build= missing) {
4443 Write-Host " ${GREEN} SUCCESS: Dependencies installed successfully.${NC} "
45- } catch {
44+ } else {
4645 Write-Host " ${RED} ERROR: Conan failed to install dependencies.${NC} "
4746 exit 1
4847}
4948
5049# Step 5: Configure the project with CMake
5150Write-Host " ${YELLOW} Configuring the project with CMake...${NC} "
5251cd $BUILD_DIR
53- try {
54- cmake .. - G " Visual Studio 15 2017" - DCMAKE_TOOLCHAIN_FILE= " conan_toolchain.cmake"
52+ if (cmake .. - DCMAKE_TOOLCHAIN_FILE= " build/Release/generators/conan_toolchain.cmake" - DCMAKE_BUILD_TYPE= Release) {
5553 Write-Host " ${GREEN} SUCCESS: CMake configuration completed.${NC} "
56- } catch {
54+ } else {
5755 Write-Host " ${RED} ERROR: CMake configuration failed.${NC} "
5856 exit 1
5957}
6058
6159# Step 6: Build the project
6260Write-Host " ${YELLOW} Building the project...${NC} "
63- try {
64- cmake -- build . -- config Release
61+ if (cmake -- build .) {
6562 Write-Host " ${GREEN} SUCCESS: Project built successfully.${NC} "
66- } catch {
63+ } else {
6764 Write-Host " ${RED} ERROR: Build failed.${NC} "
6865 exit 1
6966}
You can’t perform that action at this time.
0 commit comments