Blame view

RIOT/pkg/relic/generate-cmake-xcompile.perl 1.11 KB
fb11e647   vrobic   reseau statique a...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  #!/usr/bin/env perl
  print "INCLUDE(CMakeForceCompiler)\n";
  print "\n";
  print "\n";
  print "SET(CMAKE_SYSTEM_NAME Generic)\n";
  print "SET(CMAKE_SYSTEM_VERSION 1)\n";
  print "\n";
  print "SET(CMAKE_C_COMPILER \"$ENV{CC}\" CACHE STRING \"\")\n";
  print "SET(CMAKE_CXX_COMPILER \"$ENV{CXX}\" CACHE STRING \"\")\n";
  print "SET(CMAKE_RANLIB \"echo\" CACHE STRING \"\")\n";
  
  print "\n";
  print "# specify the cross compiler\n";
  print "CMAKE_FORCE_C_COMPILER(\${CMAKE_C_COMPILER} GNU)\n";
  print "CMAKE_FORCE_CXX_COMPILER(\${CMAKE_CXX_COMPILER} GNU)\n";
  print "SET(CMAKE_LINKER \"$ENV{LINK}\" CACHE STRING \"\")\n";
  print "\n";
  my $esc_c_flags = "$ENV{CFLAGS}";
  $esc_c_flags =~ s/"/\\"/g;
  print "SET(CMAKE_C_FLAGS \"$esc_c_flags\" CACHE STRING \"\")\n";
  print "\n";
  print "SET(CMAKE_EXE_LINKER_FLAGS \"$ENV{LINKFLAGS}\" CACHE STRING \"\")\n";
  
  print "\n";
  print "# search for programs in the build host directories\n";
  print "SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n";
  print "# for libraries and headers in the target directories\n";
  print "SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n";
  print "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n";