2023-09-23 07:56:27 +00:00
|
|
|
cmake_minimum_required( VERSION 3.16 )
|
2020-04-07 22:19:49 +00:00
|
|
|
|
|
|
|
if( NOT CMAKE_CROSSCOMPILING )
|
|
|
|
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG" )
|
|
|
|
|
2021-11-06 15:48:31 +00:00
|
|
|
if (MSVC)
|
|
|
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244 /wd4267" )
|
|
|
|
endif()
|
|
|
|
|
2020-04-07 22:19:49 +00:00
|
|
|
add_executable( lemon lemon.c )
|
|
|
|
set( CROSS_EXPORTS ${CROSS_EXPORTS} lemon PARENT_SCOPE )
|
|
|
|
|
2021-03-14 15:44:58 +00:00
|
|
|
# Lemon wants lempar.c in its directory
|
|
|
|
add_custom_command( TARGET lemon
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND echo $<TARGET_FILE_DIR:lemon>
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/lempar.c $<TARGET_FILE_DIR:lemon> )
|
|
|
|
endif()
|