Skip to content

Commit

Permalink
Initialized CMake variables for configure as 0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
botanegg committed Oct 10, 2021
1 parent 3069cc2 commit 257653f
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,25 @@ endfunction()

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

# Configure config_type.h
check_include_files(inttypes.h INCLUDE_INTTYPES_H)
check_include_files(stdint.h INCLUDE_STDINT_H)
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H)
# Configure config_type.h (workaround to work both configure and cmake)
set(INCLUDE_INTTYPES_H 0)
set(INCLUDE_STDINT_H 0)
set(INCLUDE_SYS_TYPES_H 0)
check_include_files(inttypes.h INCLUDE_INTTYPES_H_)
check_include_files(stdint.h INCLUDE_STDINT_H_)
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H_)

if(INCLUDE_INTTYPES_H_ EQUAL 1)
set(INCLUDE_INTTYPES_H 1)
endif()

if(INCLUDE_STDINT_H_ EQUAL 1)
set(INCLUDE_STDINT_H 1)
endif()

if(INCLUDE_SYS_TYPES_H_ EQUAL 1)
set(INCLUDE_SYS_TYPES_H 1)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(SIZE16 int16_t)
Expand Down

0 comments on commit 257653f

Please sign in to comment.