Skip to content

Commit 257653f

Browse files
committed
Initialized CMake variables for configure as 0
Init INCLUDE_INTTYPES_H, INCLUDE_STDINT_H, INCLUDE_SYS_TYPES_H, CMake variables as 0 It is need to prevent generate broken code in config_types.h So next code was genarated before ... ... And got error: expected value in expression
1 parent 3069cc2 commit 257653f

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

CMakeLists.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,25 @@ endfunction()
5050

5151
message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
5252

53-
# Configure config_type.h
54-
check_include_files(inttypes.h INCLUDE_INTTYPES_H)
55-
check_include_files(stdint.h INCLUDE_STDINT_H)
56-
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H)
53+
# Configure config_type.h (workaround to work both configure and cmake)
54+
set(INCLUDE_INTTYPES_H 0)
55+
set(INCLUDE_STDINT_H 0)
56+
set(INCLUDE_SYS_TYPES_H 0)
57+
check_include_files(inttypes.h INCLUDE_INTTYPES_H_)
58+
check_include_files(stdint.h INCLUDE_STDINT_H_)
59+
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H_)
60+
61+
if(INCLUDE_INTTYPES_H_ EQUAL 1)
62+
set(INCLUDE_INTTYPES_H 1)
63+
endif()
64+
65+
if(INCLUDE_STDINT_H_ EQUAL 1)
66+
set(INCLUDE_STDINT_H 1)
67+
endif()
68+
69+
if(INCLUDE_SYS_TYPES_H_ EQUAL 1)
70+
set(INCLUDE_SYS_TYPES_H 1)
71+
endif()
5772

5873
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
5974
set(SIZE16 int16_t)

0 commit comments

Comments
 (0)