diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dba913..e58f344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,19 @@ SET(CMAKE_BUILD_TYPE "Release") include_directories("/usr/local/include") link_directories("/usr/local/lib") +if (BUILD NOT STREQUAL "docker") + #在编译选项中加入c99支持 + add_compile_options(-std=c99) + message(STATUS "optional:-std=c99") +endif () + add_executable(cmoe cmoe.c) add_executable(cmoeditor editor.c) target_link_libraries(cmoe spb) target_link_libraries(cmoeditor spb) -#INSTALL(TARGETS cmoe RUNTIME DESTINATION bin) +if (BUILD STREQUAL "docker") + INSTALL(TARGETS cmoe RUNTIME DESTINATION bin) +endif () INSTALL(TARGETS cmoeditor RUNTIME DESTINATION bin) diff --git a/Dockerfile b/Dockerfile index 009e8db..febe8bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ COPY ./CMakeLists.txt . RUN mkdir build \ && cd build \ - && cmake .. \ + && cmake -DBUILD=docker .. \ && make install FROM alpine:latest