Add DEVELOP option to CMake

This requires CMake 3.0 so -Werror won't conflict with link tests.
Remove all version checks to improve simplicity.
This commit is contained in:
James Larrowe
2020-08-16 13:23:29 -04:00
parent fcfecc6e82
commit 5a9f2b7750
2 changed files with 36 additions and 56 deletions

View File

@@ -17,23 +17,12 @@ BISON_TARGET(ASMy "asm/asmy.y"
DEFINES_FILE "${PROJECT_SOURCE_DIR}/src/asm/asmy.h"
)
# Lexer is not present yet
if(False) # FLEX_FOUND
FLEX_TARGET(Lexer "asm/lexer.l"
"${PROJECT_SOURCE_DIR}/src/asm/lexer.c"
)
ADD_FLEX_BISON_DEPENDENCY(Lexer ASMy)
set(Lexer_SOURCE "${FLEX_Lexer_OUTPUTS}")
else()
set(Lexer_SOURCE "asm/lexer.c")
endif()
set(rgbasm_src
"${BISON_ASMy_OUTPUT_SOURCE}"
"${Lexer_SOURCE}"
"asm/charmap.c"
"asm/fstack.c"
"asm/globlex.c"
"asm/lexer.c"
"asm/macro.c"
"asm/main.c"
"asm/math.c"
@@ -79,22 +68,12 @@ foreach(PROG "asm" "fix" "gfx" "link")
install(TARGETS rgb${PROG} RUNTIME DESTINATION bin)
endforeach()
if(CMAKE_VERSION VERSION_LESS 2.8.12)
add_definitions(${PNG_DEFINITIONS})
include_directories(${PNG_INCLUDE_DIRS})
target_link_libraries(rgbgfx ${PNG_LIBRARIES})
else()
target_compile_definitions(rgbgfx PRIVATE ${PNG_DEFINITIONS})
target_include_directories(rgbgfx PRIVATE ${PNG_INCLUDE_DIRS})
target_link_libraries(rgbgfx PRIVATE ${PNG_LIBRARIES})
endif()
target_compile_definitions(rgbgfx PRIVATE ${PNG_DEFINITIONS})
target_include_directories(rgbgfx PRIVATE ${PNG_INCLUDE_DIRS})
target_link_libraries(rgbgfx PRIVATE ${PNG_LIBRARIES})
include(CheckLibraryExists)
check_library_exists("m" "sin" "" HAS_LIBM)
if(HAS_LIBM)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
target_link_libraries(rgbasm LINK_PRIVATE "m")
else()
target_link_libraries(rgbasm PRIVATE "m")
endif()
target_link_libraries(rgbasm PRIVATE "m")
endif()