Sonntag, 12. März 2017

Edit Windows UEFI boot entry using windows PE

To be able to edit the boot settings you need to be able to boot from another boot device like USB stick or CD. You need to create a bootable WinPE boot media first
When you have started the WinPE (this should work starting with WinPE for Windows 7) environment open a command line and start a command prompt. First you need to mount the EFI system partition:

# diskpart
# list disk
# sel disk 0
# list partition
# assign letter=b
# exit

Now the EFI system partition should be as drive b:.

In the next step you can start to edit you BCD entry:

# bcedit /store b:/efi/microsoft/boot/bcd /enum
# bcedit /store b:/efi/microsoft/boot/bcd /deletevalue {default} safeboot

In this example a safeboot entry would be deleted from the store.

Dienstag, 31. Januar 2017

Configure CodeLite to develop C++14 applications with CMake and CLang

First configure CodeLite so that it uses CLang for code completion: Settings -> Code Completion... -> Clang. Enable both Enable clang code completion and Only use clang code completion.

The structure of the project will be:
<project dir>
  |- Debug
  |- src
  |- Release

Create first a new workspace and then open the Workspace Settings....

On the Code Completion tab select Enable C++14 Standard.

Create a new project inside this workspace (File -> New -> New Project) and select Others -> Custom makefile as project type. Then select a project name and the <project dir> for the project path. Select the clang compiler, LLDB Debugger and CMake in the next step and finish the project wizard.

Select Import Files From Directory to import your source files.

Open the project settings and adjust the following settings:

  • Intermediate Folder: $(ProjectPath)/$(ConfigurationName)
  • Output File: Name of your executable
  • Executable to Run / Debug: $(ProjectPath)/$(ConfigurationName)/$(OutputFile)
Custom Build:

  • Working Directory: $(ProjectPath)/$(ConfigurationName)
  • CMake: mkdir -p $(ProjectPath)/$(ConfigurationName) && cd $(ProjectPath)/$(ConfigurationName)  && cmake ../src -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_BUILD_TYPE=Debug
Repeat the steps also for the Release configuration and change -DCMAKE_BUILD_TYPE=Debug to -DCMAKE_BUILD_TYPE=Release.

Then execute your custom CMake command:

and the build your project.

Now the code completion should work.

A list of variables supported by CodeLite can be found in the following source file: macrosdlg.cpp