From 268cc1113f8ce8045aebd3e30350c01f0b48714d Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Sun, 31 Oct 2021 16:42:57 -0700 Subject: [PATCH] cmake: add float support (#100) --- CMakeLists.txt | 4 ++-- csrc/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1723ee2..fc19ba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ endif(UNISTD) # 1. Build pforth executable add_executable(pforth csrc/pf_main.c) -target_link_libraries(pforth ${PROJECT_NAME}_lib) +target_link_libraries(pforth ${PROJECT_NAME}_lib m) # 2. Build pforth.dic by compiling system.fth set(PFORTH_DIC "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/pforth.dic") @@ -83,7 +83,7 @@ add_dependencies(${PROJECT_NAME}_lib_sd pforth_dic_header) # 4. Build pforth_standalone using the precompiled dictionary. add_executable(pforth_standalone csrc/pf_main.c) -target_link_libraries(pforth_standalone ${PROJECT_NAME}_lib_sd) +target_link_libraries(pforth_standalone ${PROJECT_NAME}_lib_sd m) target_compile_definitions(pforth_standalone PRIVATE PF_STATIC_DIC) add_dependencies(pforth_standalone pforth_dic_header) diff --git a/csrc/CMakeLists.txt b/csrc/CMakeLists.txt index 6cacd16..f4517fa 100644 --- a/csrc/CMakeLists.txt +++ b/csrc/CMakeLists.txt @@ -34,7 +34,9 @@ else() endif() add_library(${PROJECT_NAME}_lib ${SOURCES} ${PLATFORM}) +target_compile_definitions(${PROJECT_NAME}_lib PRIVATE PF_SUPPORT_FP) # Compile the same library but with an option for the static dictionary. add_library(${PROJECT_NAME}_lib_sd STATIC ${SOURCES} ${PLATFORM}) target_compile_definitions(${PROJECT_NAME}_lib_sd PRIVATE PF_STATIC_DIC) +target_compile_definitions(${PROJECT_NAME}_lib_sd PRIVATE PF_SUPPORT_FP) -- 2.30.2