mirror of
https://github.com/hyprwm/hyprlang.git
synced 2024-11-16 18:25:57 +01:00
CMake: Use library aliases instead of library names (#55)
This changeset makes it possible to compile hyprlang with a custom install prefix, which was not honored because of using "hyprutils" as a raw dependency, which means that CMake was adding "-lhyprutils" flag to the linker, but the linker didn't know the path in case a custom install prefix was used to compile hyprutils.
This commit is contained in:
parent
5b175c9704
commit
dfeb5811dd
1 changed files with 3 additions and 2 deletions
|
@ -56,13 +56,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
message(STATUS "Using clang++ to compile hyprlang")
|
message(STATUS "Using clang++ to compile hyprlang")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_library(hypr::hyprlang ALIAS hyprlang)
|
||||||
install(TARGETS hyprlang)
|
install(TARGETS hyprlang)
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
add_custom_target(tests)
|
add_custom_target(tests)
|
||||||
|
|
||||||
add_executable(hyprlang_test "tests/parse/main.cpp")
|
add_executable(hyprlang_test "tests/parse/main.cpp")
|
||||||
target_link_libraries(hyprlang_test PRIVATE hyprlang hyprutils)
|
target_link_libraries(hyprlang_test PRIVATE hypr::hyprlang)
|
||||||
add_test(
|
add_test(
|
||||||
NAME "Parsing"
|
NAME "Parsing"
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
||||||
|
@ -70,7 +71,7 @@ add_test(
|
||||||
add_dependencies(tests hyprlang_test)
|
add_dependencies(tests hyprlang_test)
|
||||||
|
|
||||||
add_executable(hyprlang_fuzz "tests/fuzz/main.cpp")
|
add_executable(hyprlang_fuzz "tests/fuzz/main.cpp")
|
||||||
target_link_libraries(hyprlang_fuzz PRIVATE hyprlang hyprutils)
|
target_link_libraries(hyprlang_fuzz PRIVATE hypr::hyprlang)
|
||||||
add_test(
|
add_test(
|
||||||
NAME "Fuzz"
|
NAME "Fuzz"
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
||||||
|
|
Loading…
Reference in a new issue