<commit_before># additional compiler and linker instructions to include wxWidgets binaries in Nim
# <NAME> (@couven92), 2017

import ospaths

when defined(wxWidgetsPath):
  const wxWidgetsPath {.strdefine.}: string = ""
  when len(wxWidgetsPath) < 1:
    {.error: "wxWidgetsPath must not be an empty string when defined".}
else:
  when defined(windows):
    {.warning: "Compiling without wxWidgetsPath assumes that your compiler knows where to find the wxWidgets files".}
  else:
    {.warning: "Compiling without wxWidgetsPath assumes wx-config is in your path".}

when defined(vcc):
  when defined(windows):
    {.passC: "/D__WXMSW__".}
    # Include basic Windows libraries required by wxWidgets. VCC does dead code emilination of these include libraries if something is not required during linking.
    {.passL: "kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib".}

  when defined(wxWidgetsPath):
    {.passC: "/I\"" & (wxWidgetsPath / "include") & "\"" .}
    when defined(i386):
      const wxWidgetsLibPath: string = wxWidgetsPath / "lib" / "vc_lib"
    elif defined(amd64):
      const wxWidgetsLibPath: string = wxWidgetsPath / "lib" / "vc_x64_lib"
    when defined(windows):
      {.passC: "/I\"" & (wxWidgetsLibPath / "mswu") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_adv.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_aui.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_core.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_gl.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_html.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_media.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_propgrid.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_qa.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_ribbon.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_richtext.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_stc.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_webview.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_xrc.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxbase30u.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxbase30u_net.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxbase30u_xml.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxexpat.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxjpeg.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxpng.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxregexu.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxscintilla.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxtiff.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxzlib.lib") & "\"".}
  else: # not defined(wxWidgetsPath)
    # Assume wxWidgets lib library included in linker library directory path
    {.passL: "wxmsw30u_adv.lib wxmsw30u_aui.lib wxmsw30u_core.lib wxmsw30u_gl.lib wxmsw30u_html.lib wxmsw30u_media.lib wxmsw30u_propgrid.lib wxmsw30u_qa.lib wxmsw30u_ribbon.lib wxmsw30u_richtext.lib wxmsw30u_stc.lib wxmsw30u_webview.lib wxmsw30u_xrc.lib".}
    {.passL: "wxbase30u.lib wxbase30u_net.lib wxbase30u_xml.lib wxexpat.lib wxjpeg.lib wxpng.lib wxregexu.lib wxscintilla.lib wxtiff.lib wxzlib.lib".}

elif defined(gcc):
  when defined(windows):
    {.passC: "-D__WXMSW__".}
    # Include basic Windows libraries required by wxWidgets. VCC does dead code emilination of these include libraries if something is not required during linking.
    {.passL: "-lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32".}
    when defined(wxWidgetsPath):<commit_msg>support clang compilation (under OSX)<commit_after># additional compiler and linker instructions to include wxWidgets binaries in Nim
# <NAME> (@couven92), 2017

import ospaths

when defined(wxWidgetsPath):
  const wxWidgetsPath {.strdefine.}: string = ""
  when len(wxWidgetsPath) < 1:
    {.error: "wxWidgetsPath must not be an empty string when defined".}
else:
  when defined(windows):
    {.warning: "Compiling without wxWidgetsPath assumes that your compiler knows where to find the wxWidgets files".}
  else:
    {.warning: "Compiling without wxWidgetsPath assumes wx-config is in your path".}

when defined(vcc):
  when defined(windows):
    {.passC: "/D__WXMSW__".}
    # Include basic Windows libraries required by wxWidgets. VCC does dead code emilination of these include libraries if something is not required during linking.
    {.passL: "kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib".}

  when defined(wxWidgetsPath):
    {.passC: "/I\"" & (wxWidgetsPath / "include") & "\"" .}
    when defined(i386):
      const wxWidgetsLibPath: string = wxWidgetsPath / "lib" / "vc_lib"
    elif defined(amd64):
      const wxWidgetsLibPath: string = wxWidgetsPath / "lib" / "vc_x64_lib"
    when defined(windows):
      {.passC: "/I\"" & (wxWidgetsLibPath / "mswu") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_adv.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_aui.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_core.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_gl.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_html.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_media.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_propgrid.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_qa.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_ribbon.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_richtext.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_stc.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_webview.lib") & "\"".}
      {.passL: "\"" & (wxWidgetsLibPath / "wxmsw30u_xrc.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxbase30u.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxbase30u_net.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxbase30u_xml.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxexpat.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxjpeg.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxpng.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxregexu.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxscintilla.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxtiff.lib") & "\"".}
    {.passL: "\"" & (wxWidgetsLibPath / "wxzlib.lib") & "\"".}
  else: # not defined(wxWidgetsPath)
    # Assume wxWidgets lib library included in linker library directory path
    {.passL: "wxmsw30u_adv.lib wxmsw30u_aui.lib wxmsw30u_core.lib wxmsw30u_gl.lib wxmsw30u_html.lib wxmsw30u_media.lib wxmsw30u_propgrid.lib wxmsw30u_qa.lib wxmsw30u_ribbon.lib wxmsw30u_richtext.lib wxmsw30u_stc.lib wxmsw30u_webview.lib wxmsw30u_xrc.lib".}
    {.passL: "wxbase30u.lib wxbase30u_net.lib wxbase30u_xml.lib wxexpat.lib wxjpeg.lib wxpng.lib wxregexu.lib wxscintilla.lib wxtiff.lib wxzlib.lib".}

elif defined(gcc) or defined(clang):
  when defined(windows):
    {.passC: "-D__WXMSW__".}
    # Include basic Windows libraries required by wxWidgets. VCC does dead code emilination of these include libraries if something is not required during linking.
    {.passL: "-lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32".}
    when defined(wxWidgetsPath):
{'fraction_non_alphanumeric': 0.1853546910755149, 'fraction_numerical': 0.03051106025934401, 'mean_word_length': 3.432112676056338, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6459406', 'n_tokens_mistral': 3227, 'n_tokens_neox': 3049, 'n_words': 585}