Browse Source

Small improvements to build

Julius Pfrommer 10 years ago
parent
commit
5d247544a9
2 changed files with 6 additions and 3 deletions
  1. 2 0
      CMakeLists.txt
  2. 4 3
      tools/generate_builtin.py

+ 2 - 0
CMakeLists.txt

@@ -4,7 +4,9 @@ set (open62541_VERSION_MAJOR 0)
 set (open62541_VERSION_MINOR 1)
 set (open62541_VERSION_MINOR 1)
 
 
 # set (CMAKE_VERBOSE_MAKEFILE on )
 # set (CMAKE_VERBOSE_MAKEFILE on )
+if (CMAKE_COMPILER_IS_GNUCC)
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -pipe -fstack-protector -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-unused-label -Wpointer-arith -Wformat -Wreturn-type -Wsign-compare -Wmultichar -Wformat-nonliteral -Winit-self -Wuninitialized -Wno-deprecated -Wformat-security -Werror -ffunction-sections -fdata-sections -Wl,--gc-sections")
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -pipe -fstack-protector -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-unused-label -Wpointer-arith -Wformat -Wreturn-type -Wsign-compare -Wmultichar -Wformat-nonliteral -Winit-self -Wuninitialized -Wno-deprecated -Wformat-security -Werror -ffunction-sections -fdata-sections -Wl,--gc-sections")
+endif (CMAKE_COMPILER_IS_GNUCC)
 
 
 # multithreading
 # multithreading
 set (MULTITHREADING OFF CACHE BOOL "Enable multithreading")
 set (MULTITHREADING OFF CACHE BOOL "Enable multithreading")

+ 4 - 3
tools/generate_builtin.py

@@ -284,9 +284,10 @@ printh('''/**
 #define ''' + args.outfile.upper().split("/")[-1] + '''_H_
 #define ''' + args.outfile.upper().split("/")[-1] + '''_H_
 
 
 #include "ua_types.h"
 #include "ua_types.h"
-#include "ua_types_encoding_binary.h"
-#include "ua_types_encoding_xml.h"
-#include "ua_namespace_0.h"\n''')
+#include "ua_types_encoding_binary.h"''')
+if args.with_xml:
+	printh('#include "ua_types_encoding_xml.h"')
+printh('#include "ua_namespace_0.h"\n')
 
 
 printc('''/**
 printc('''/**
  * @file '''+sys.argv[2]+'''.c
  * @file '''+sys.argv[2]+'''.c