Browse Source

compile with PathScale compiler

ambrop7 13 năm trước cách đây
mục cha
commit
550b936ff9
3 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 5 1
      CMakeLists.txt
  2. 1 1
      ncd/CMakeLists.txt
  3. 0 0
      ncd/include_linux_input.c

+ 5 - 1
CMakeLists.txt

@@ -110,7 +110,11 @@ endif ()
 if (MSVC)
     add_definitions(/TP -D_CRT_SECURE_NO_WARNINGS /wd4065 /wd4018 /wd4533 /wd4244 /wd4102)
 else ()
-    add_definitions(-std=gnu99 -Werror=implicit-function-declaration -Wno-unused-value -Wno-parentheses -Wno-switch-enum -Wno-switch -Wredundant-decls)
+    add_definitions(-std=gnu99 -Wno-unused-value -Wno-parentheses -Wno-switch -Wredundant-decls)
+
+    if (NOT CMAKE_C_COMPILER_ID STREQUAL "PathScale")
+        add_definitions(-Werror=implicit-function-declaration -Wno-switch-enum)
+    endif ()
 endif ()
 
 # platform-specific stuff

+ 1 - 1
ncd/CMakeLists.txt

@@ -153,7 +153,7 @@ target_link_libraries(badvpn-ncd system flow flowextra dhcpclient arpprobe ncdva
 
 if (BADVPN_USE_LINUX_INPUT)
     string(REPLACE " " ";" FLAGS_LIST "${CMAKE_C_FLAGS}")
-    execute_process(COMMAND ${CMAKE_C_COMPILER} ${FLAGS_LIST} -E ${CMAKE_CURRENT_SOURCE_DIR}/include_linux_input.h
+    execute_process(COMMAND ${CMAKE_C_COMPILER} ${FLAGS_LIST} -E ${CMAKE_CURRENT_SOURCE_DIR}/include_linux_input.c
                     RESULT_VARIABLE LINUX_INPUT_PREPROCESS_RESULT
                     OUTPUT_VARIABLE LINUX_INPUT_PREPROCESS_OUTPUT)
     if (NOT LINUX_INPUT_PREPROCESS_RESULT EQUAL 0)

+ 0 - 0
ncd/include_linux_input.h → ncd/include_linux_input.c