Improve CMake system and compiler checks

This commit is contained in:
Oliver Hamlet
2025-11-02 19:54:16 +00:00
parent 19873b29a0
commit 86ff2a665b
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -177,7 +177,7 @@ set_target_properties(loot PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(WIN32)
target_compile_definitions(loot PRIVATE UNICODE _UNICODE LOOT_EXPORT)
set(LOOT_LIBS ntdll ws2_32 bcrypt)
@@ -185,7 +185,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(loot PRIVATE ${LOOT_LIBS})
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(loot PRIVATE
"-Wall"
"-Wextra"
@@ -367,7 +367,7 @@ if(NOT DEFINED CPACK_PACKAGE_VERSION)
set(CPACK_PACKAGE_VERSION ${GIT_DESCRIBE_STRING})
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(WIN32)
set(CPACK_GENERATOR "7Z")
else()
set(CPACK_GENERATOR "TXZ")
+2 -2
View File
@@ -93,7 +93,7 @@ set_target_properties(libloot_tests PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(WIN32)
target_compile_definitions(libloot_tests PRIVATE UNICODE _UNICODE)
if((NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") OR NOT LIBLOOT_BUILD_SHARED)
@@ -103,7 +103,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(libloot_tests PRIVATE ${LOOT_LIBS})
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(libloot_tests PRIVATE "-Wall" "-Wextra")
endif()