Skip to content

Commit b1410b5

Browse files
author
Oleh Kulykov
committed
1722611606
1 parent 5b16d77 commit b1410b5

File tree

2 files changed

+10
-37
lines changed

2 files changed

+10
-37
lines changed

CMakeLists.txt

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,9 @@ More info: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run
9797

9898

9999
# ---- definitions ----
100-
if (WIN32 OR WIN64)
100+
if (WIN32)
101101
add_definitions(-DUNICODE=1)
102102
add_definitions(-D_UNICODE=1)
103-
104-
if (WIN64 OR CMAKE_SIZEOF_VOID_P EQUAL 8)
105-
message("WIN 64")
106-
add_definitions(-DWIN64=1)
107-
add_definitions(-D_WIN64=1)
108-
elseif (WIN32 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
109-
message("WIN 32")
110-
add_definitions(-DWIN32=1)
111-
add_definitions(-D_WIN32=1)
112-
else()
113-
message("WIN.. undefined")
114-
endif()
115-
116103
endif()
117104

118105
if (MINGW)
@@ -284,27 +271,26 @@ endif()
284271

285272
# ---- check functions ----
286273
if (MSVC)
287-
check_symbol_exists(_wfopen_s "stdio.h" HAVE__WFOPEN_S)
288-
if (NOT HAVE__WFOPEN_S)
289-
check_symbol_exists(_wfopen_s "wchar.h" HAVE__WFOPEN_S)
290-
endif()
274+
set(LIBPLZMA_CHECK_SYMBOL_HEADERS
275+
stdio.h
276+
stdlib.h
277+
wchar.h
278+
)
279+
check_symbol_exists(_wfopen_s ${LIBPLZMA_CHECK_SYMBOL_HEADERS} HAVE__WFOPEN_S)
291280
if (HAVE__WFOPEN_S)
292281
add_definitions(-DHAVE__WFOPEN_S=1)
293282
endif()
294283

295-
check_symbol_exists(_wdupenv_s "stdlib.h" HAVE__WDUPENV_S)
296-
if (NOT HAVE__WDUPENV_S)
297-
check_symbol_exists(_wdupenv_s "wchar.h" HAVE__WDUPENV_S)
298-
endif()
284+
check_symbol_exists(_wdupenv_s ${LIBPLZMA_CHECK_SYMBOL_HEADERS} HAVE__WDUPENV_S)
299285
if (HAVE__WDUPENV_S)
300286
add_definitions(-DHAVE__WDUPENV_S=1)
301287
endif()
302288

303-
check_symbol_exists(_dupenv_s "stdlib.h" HAVE__DUPENV_S)
289+
check_symbol_exists(_dupenv_s ${LIBPLZMA_CHECK_SYMBOL_HEADERS} HAVE__DUPENV_S)
304290
if (HAVE__DUPENV_S)
305291
add_definitions(-DHAVE__DUPENV_S=1)
306292
endif()
307-
endif(MSVC)
293+
endif()
308294

309295

310296
# ---- include ----

cmake_tests/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@ remove_definitions(-DLIBPLZMA_BUILD=1)
3737
if (WIN32 OR WIN64)
3838
add_definitions(-DUNICODE=1)
3939
add_definitions(-D_UNICODE=1)
40-
41-
if (WIN64 OR CMAKE_SIZEOF_VOID_P EQUAL 8)
42-
message("WIN 64")
43-
add_definitions(-DWIN64=1)
44-
add_definitions(-D_WIN64=1)
45-
elseif (WIN32 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
46-
message("WIN 32")
47-
add_definitions(-DWIN32=1)
48-
add_definitions(-D_WIN32=1)
49-
else()
50-
message("WIN.. undefined")
51-
endif()
52-
5340
endif()
5441

5542
if (MINGW)

0 commit comments

Comments
 (0)