1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
# otp_header_parse needs to be compiled a build-arch (native) tool and not for
# the host architecture
set(ENV{CC} ${CC_FOR_BUILD})
set(ENV{CXX} ${CXX_FOR_BUILD})
set(ENV{LDFLAGS} ${LDFLAGS_FOR_BUILD})
set(ENV{CFLAGS} ${CFLAGS_FOR_BUILD} ${CPPFLAGS_FOR_BUILD})
set(ENV{CXXFLAGS} ${CXXFLAGS_FOR_BUILD} ${CPPFLAGS_FOR_BUILD})
cmake_minimum_required(VERSION 3.12)
PROJECT(otp_header_parser CXX)
set(CMAKE_CXX_STANDARD 14)
add_executable(otp_header_parse otp_header_parse.cpp)
if (CODE_OTP)
target_compile_definitions(otp_header_parse PRIVATE CODE_OTP=${CODE_OTP})
endif()
set(JSON_BuildTests OFF CACHE INTERNAL "")
add_subdirectory(../lib/nlohmann_json ${CMAKE_CURRENT_BINARY_DIR}/../lib/nlohmann_json EXCLUDE_FROM_ALL)
if (NOT TARGET nlohmann_json)
message(FATAL_ERROR "JSON library not found - check you have all the submodules")
else()
target_link_libraries(otp_header_parse nlohmann_json)
endif()
|