[all] cmake: standardize indentation to 2 spaces

This commit is contained in:
Quantum
2022-05-28 14:45:13 -04:00
committed by Geoffrey McRae
parent 0799910e70
commit a8521b821e
18 changed files with 381 additions and 382 deletions

View File

@@ -4,7 +4,7 @@ project(lg_common LANGUAGES C)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include
)
add_definitions(-D_GNU_SOURCE)
@@ -42,8 +42,8 @@ add_library(lg_common STATIC ${COMMON_SOURCES})
target_link_libraries(lg_common lg_common_platform)
target_include_directories(lg_common
INTERFACE
include
PRIVATE
src
INTERFACE
include
PRIVATE
src
)

View File

@@ -2,21 +2,21 @@ cmake_minimum_required(VERSION 3.0)
project(lg_common_platform_code LANGUAGES C)
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_TOP}
${PROJECT_SOURCE_DIR}/include
${PROJECT_TOP}
)
add_library(lg_common_platform_code STATIC
debug.c
crash.c
sysinfo.c
thread.c
event.c
ivshmem.c
time.c
paths.c
open.c
cpuinfo.c
debug.c
crash.c
sysinfo.c
thread.c
event.c
ivshmem.c
time.c
paths.c
open.c
cpuinfo.c
)
if(ENABLE_BACKTRACE)
@@ -25,7 +25,7 @@ if(ENABLE_BACKTRACE)
endif()
target_link_libraries(lg_common_platform_code
lg_common
pthread
rt
lg_common
pthread
rt
)

View File

@@ -2,49 +2,49 @@ cmake_minimum_required(VERSION 3.0)
project(lg_common_platform_code LANGUAGES C)
include_directories(
${PROJECT_TOP}/vendor/ivshmem
${PROJECT_TOP}/vendor/ivshmem
)
# allow use of functions for Windows 7 or later
add_compile_definitions(WINVER=0x0601 _WIN32_WINNT=0x0601)
if (MINGW)
# Build our own ntdll.dll import library
# This tricks MinGW into not linking stuff like memcpy from ntdll.dll instead of mscvrt.dll
if(NOT CMAKE_DLLTOOL)
# cmake older than 3.16 doesn't know how to find dlltool
find_program(CMAKE_DLLTOOL NAMES "x86_64-w64-mingw32-dlltool" "dlltool.exe" DOC "dlltool executable")
endif()
add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/ntdll.a"
COMMAND "${CMAKE_DLLTOOL}" -d "${PROJECT_SOURCE_DIR}/ntdll.def" -l "${PROJECT_BINARY_DIR}/ntdll.a"
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/ntdll.def"
COMMENT "Building import library ntdll.a"
VERBATIM
)
add_custom_target(ntdll_target DEPENDS "${PROJECT_BINARY_DIR}/ntdll.a")
add_library(ntdll STATIC IMPORTED GLOBAL)
add_dependencies(ntdll ntdll_target)
set_target_properties(ntdll PROPERTIES IMPORTED_LOCATION "${PROJECT_BINARY_DIR}/ntdll.a")
# Build our own ntdll.dll import library
# This tricks MinGW into not linking stuff like memcpy from ntdll.dll instead of mscvrt.dll
if(NOT CMAKE_DLLTOOL)
# cmake older than 3.16 doesn't know how to find dlltool
find_program(CMAKE_DLLTOOL NAMES "x86_64-w64-mingw32-dlltool" "dlltool.exe" DOC "dlltool executable")
endif()
add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/ntdll.a"
COMMAND "${CMAKE_DLLTOOL}" -d "${PROJECT_SOURCE_DIR}/ntdll.def" -l "${PROJECT_BINARY_DIR}/ntdll.a"
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/ntdll.def"
COMMENT "Building import library ntdll.a"
VERBATIM
)
add_custom_target(ntdll_target DEPENDS "${PROJECT_BINARY_DIR}/ntdll.a")
add_library(ntdll STATIC IMPORTED GLOBAL)
add_dependencies(ntdll ntdll_target)
set_target_properties(ntdll PROPERTIES IMPORTED_LOCATION "${PROJECT_BINARY_DIR}/ntdll.a")
endif()
add_library(lg_common_platform_code STATIC
debug.c
crash.c
sysinfo.c
thread.c
event.c
windebug.c
ivshmem.c
time.c
cpuinfo.c
debug.c
crash.c
sysinfo.c
thread.c
event.c
windebug.c
ivshmem.c
time.c
cpuinfo.c
)
target_link_libraries(lg_common_platform_code
lg_common
setupapi
ntdll
lg_common
setupapi
ntdll
)
if (ENABLE_BACKTRACE)
target_link_libraries(lg_common_platform_code dbghelp)
target_link_libraries(lg_common_platform_code dbghelp)
endif()