mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 13:29:48 +01:00
cmake: macro-prefix-map, compile_commands.json (#338)
* cmake: position independent build for `__FILE__` * cmake: generate compile_commands.json, coder-friendly
This commit is contained in:
parent
997f222b0f
commit
18d2d2ba6a
1 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@ project(hyprlock
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
|
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
|
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
|
||||||
message(STATUS "Configuring hyprlock in Debug with CMake")
|
message(STATUS "Configuring hyprlock in Debug with CMake")
|
||||||
|
@ -27,7 +28,10 @@ include(GNUInstallDirs)
|
||||||
# configure
|
# configure
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
|
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
|
||||||
-Wno-missing-field-initializers -Wno-narrowing)
|
-Wno-missing-field-initializers -Wno-narrowing)
|
||||||
|
|
||||||
|
# position independent build: __FILE__
|
||||||
|
add_compile_options(-fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=)
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
message(STATUS "Checking deps...")
|
message(STATUS "Checking deps...")
|
||||||
|
|
Loading…
Reference in a new issue