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

Can't build custom targets from project outline panel #643

Closed
fb39ca4 opened this issue Jan 25, 2019 · 4 comments
Closed

Can't build custom targets from project outline panel #643

fb39ca4 opened this issue Jan 25, 2019 · 4 comments
Labels
Feature: build Feature: Project Outline View fixed (release pending) fixed in pre-release and is pending official release

Comments

@fb39ca4
Copy link

fb39ca4 commented Jan 25, 2019

Brief Issue Summary

Custom targets which build fine from the command palette can't be built in the outline panel.

Expected:

I expect to be able to right click on a custom target and be able to build it, like I can for executable and library targets.

Apparent Behavior:

However, I can only select "run utility" which seems to do a full rebuild of the ALL target and doesn't even build the custom target. I can select and build the custom target just fine using the "Cmake: Build a target" command.

CMake Tools Log

What I get:

[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/fb39ca4/cmake-tools-bug/build --config Debug --target all -- -j 6
[build] [1/2  50% :: 0.131] Building C object CMakeFiles/hello.dir/src/main.o
[build] [2/2 100% :: 0.300] Linking C executable hello
[build] Build finished with exit code 0

What I should get:

[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/fb39ca4/cmake-tools-bug/build --config Debug --target run -- -j 6
[build] [1/1 100% :: 0.011] cd /home/fb39ca4/cmake-tools-bug/build && /home/fb39ca4/cmake-tools-bug/build/hello
[build] hello world!
[build] Build finished with exit code 0

Developer Tools Log

[Extension Host] [CMakeTools] 2019-01-25T23:40:58.483Z [debug] [extension] [4539] cmake.cleanRebuild started
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.485Z [debug] [main] Run build clean
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.551Z [debug] [main] Saving open files before configure/build
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.592Z [info] [build] Starting build
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.627Z [debug] [driver] Start build clean
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.627Z [debug] [driver] Runnnig pre-configure checks and steps
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.631Z [info] [proc] Executing command: /usr/bin/cmake --build /home/fb39ca4/cmake-tools-bug/build --config Debug --target clean --
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.742Z [info] [build] Cleaning... 2 files.
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.778Z [debug] [driver] Run _refreshExpansions
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.778Z [debug] [cms-driver] Run doRefreshExpansions
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.779Z [debug] [driver] Run _refreshExpansions cb
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.849Z [info] [build] Build finished with exit code 0
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.861Z [debug] [main] Run build 
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.911Z [debug] [cache] Reading CMake cache file /home/fb39ca4/cmake-tools-bug/build/CMakeCache.txt
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:58.912Z [debug] [cache] Parsing CMake cache string
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.090Z [debug] [main] Saving open files before configure/build
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.299Z [info] [build] Starting build
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.369Z [debug] [driver] Start build all
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.369Z [debug] [driver] Runnnig pre-configure checks and steps
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.377Z [info] [proc] Executing command: /usr/bin/cmake --build /home/fb39ca4/build --config Debug --target all -- -j 6
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.607Z [info] [build] [1/2  50% :: 0.150] Building C object CMakeFiles/hello.dir/src/main.o
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.772Z [info] [build] [2/2 100% :: 0.314] Linking C executable hello
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.794Z [debug] [driver] Run _refreshExpansions
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.795Z [debug] [cms-driver] Run doRefreshExpansions
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.796Z [debug] [driver] Run _refreshExpansions cb
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.860Z [info] [build] Build finished with exit code 0
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.882Z [debug] [extension] [4539] cmake.cleanRebuild finished (returned 0)
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.898Z [debug] [cache] Reading CMake cache file /home/fb39ca4/cmake-tools-bug/build/CMakeCache.txt
console.ts:134 [Extension Host] [CMakeTools] 2019-01-25T23:40:59.899Z [debug] [cache] Parsing CMake cache string

Platform and Versions

  • Operating System: Arch Linux
  • CMake Version: 3.13.2
  • VSCode Version: 1.30.2
  • CMake Tools Extension Version: 1.1.3
  • Compiler/Toolchain: GCC 8.2.1

Other Notes/Information

I was hoping to use this in a larger embedded project, with several custom targets to upload different binaries to the microcontroller. The binary is generated as an executable target, and the custom target calls openocd with a script to flash the microcontroller.

I cannot share that project at the moment, but I have made a minimal example that builds a hello world program (target name: hello) and has a custom target to run the program (target name: run) instead.

cmake-tools-custom-command-bug.zip

@craflin
Copy link

craflin commented Feb 15, 2019

I was about to report the same issue. But this bug report is pretty much perfect. Thanks for that! I have nothing to add. The bug is quite solid. Let me know if I can help you in any way to fix it.

@svcguy
Copy link

svcguy commented Sep 1, 2019

Can also confirm this is still an issue. Further if you right click a utility and select "Set as default target" it will properly execute that utility

@bobbrow bobbrow added the fixed (release pending) fixed in pre-release and is pending official release label Dec 27, 2019
@bobbrow
Copy link
Member

bobbrow commented Dec 27, 2019

This will be addressed in version 1.3.0. Thanks for the PR @rcxdude!

@andreeis
Copy link
Contributor

andreeis commented Feb 4, 2020

Closing since this is fixed in CMake Tools Beta2. Please reactivate if you encounter any other symptoms of this issue.

@andreeis andreeis closed this as completed Feb 4, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: build Feature: Project Outline View fixed (release pending) fixed in pre-release and is pending official release
Projects
None yet
Development

No branches or pull requests

5 participants