build: change to xmake mgr.
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(crashelper LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
message(FATAL_ERROR "Unsupported MinGW Currently.")
|
||||
endif()
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
|
||||
set(CRASHELPER_SOURCES
|
||||
src/crashelper.cxx
|
||||
)
|
||||
|
||||
include_directories(include)
|
||||
add_library(crashelper STATIC ${CRASHELPER_SOURCES})
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_libraries(crashelper PUBLIC pthread dl bfd Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_compile_options(crashelper PUBLIC -g)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
target_link_libraries(crashelper PUBLIC pthread dl bfd Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_compile_options(crashelper PUBLIC -g)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_link_libraries(crashelper PRIVATE DbgHelp Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_compile_options(crashelper PUBLIC $<$<OR:$<STREQUAL:$<CXX_COMPILER_ID>,MSVC>,$<STREQUAL:$<C_COMPILER_ID>,MSVC>>:/Zi>)
|
||||
target_link_options(crashelper PUBLIC $<$<OR:$<STREQUAL:$<CXX_COMPILER_ID>,MSVC>,$<STREQUAL:$<C_COMPILER_ID>,MSVC>>:/DEBUG>)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS: ${CMAKE_SYSTEM_NAME}. This project only supports Linux, macOS, and Windows.")
|
||||
endif()
|
||||
#message(STATUS "crashelper:${CMAKE_CURRENT_LIST_DIR}")
|
||||
target_include_directories(crashelper PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
7
crashelper/xmake.lua
Normal file
7
crashelper/xmake.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("crashelper")
|
||||
add_rules("qt.static")
|
||||
add_includedirs("include", {public = true})
|
||||
add_files("src/*.cxx")
|
||||
add_frameworks("QtCore")
|
||||
Reference in New Issue
Block a user