<commit_before>cmake_minimum_required(VERSION 2.8.10)

project(example-2)
set(TARGET example-2)
set(SOURCE main.cxx)

if(NOT SUBSYSTEM)
  set(SUBSYSTEM GLFW3)
endif()

message(" * SUBSYSTEM: ${SUBSYSTEM}")

if(SUBSYSTEM MATCHES GLFW3)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_GLFW3 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES GLFW2)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_GLFW2 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES SDL2)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_SDL2 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES SDL1)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_SDL1 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES GLUT)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_GLUT ${CMAKE_CXX_FLAGS}")
endif()

if(CMAKE_CXX_COMPILER MATCHES "/em\\+\\+(-[a-zA-Z0-9.])?$")

  message(" * C++ compiler: Emscripten")
  
  set(CMAKE_CXX_COMPILER_ID "Emscripten")
  
  #set(CMAKE_CXX_FLAGS "-s ALLOW_MEMORY_GROWTH=1 ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS "-s DISABLE_EXCEPTION_CATCHING=0 ${CMAKE_CXX_FLAGS}")
  
  set(CMAKE_CXX_FLAGS       "-std=c++11 ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS            "-Wall ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS "-pedantic-errors ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
  set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
  
  set(TARGET "${TARGET}.html")

else()

  if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    
    message(" * C++ compiler: Clang")
    
    set(CMAKE_CXX_FLAGS       "-std=c++11 ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS            "-Wall ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS "-pedantic-errors ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -march=native -DNDEBUG")
    set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -march=native -g")
    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -march=native -g")
  
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  
    message(" * C++ compiler: GCC")
    
    set(CMAKE_CXX_FLAGS       "-std=c++11 ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS            "-Wall ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS "-pedantic-errors ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -march=native -DNDEBUG")
    set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -march=native -g -pg")
    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -march=native -g -pg")
    
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
    message(" * C++ compiler: ICC")
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
    message(" * C++ compiler: MSVC++")
  else()
    message(" * C++ compiler: unknown")
  endif()

endif()

if(CMAKE_BUILD_TYPE MATCHES release)
  message(" * build type: release")
  set(CXX_FLAGS "${CMAKE_CXX_FLAGS}${CMAKE_CXX_FLAGS_RELEASE}")
  message(" * CXX_FLAGS: ${CXX_FLAGS}")
elseif(CMAKE_BUILD_TYPE MATCHES debug)
  message(" * build type: debug")
  set(CXX_FLAGS "${CMAKE_CXX_FLAGS}${CMAKE_CXX_FLAGS_DEBUG}")
  message(" * CXX_FLAGS: ${CXX_FLAGS}")
elseif(CMAKE_BUILD_TYPE MATCHES relwithdebinfo)
  message(" * build type: relwithdebinfo")
  set(CXX_FLAGS "${CMAKE_CXX_FLAGS}${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
  message(" * CXX_FLAGS: ${CXX_FLAGS}")
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../include)

message(" * target: ${TARGET}")
message(" * source: ${SOURCE}")

add_executable(${TARGET} ${SOURCE})
add_dependencies(${TARGET}
  ${CMAKE_CURRENT_SOURCE_DIR}/../../include/wonder_rabbit_project/wonderland.subsystem.hxx
)

if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Emscripten")
  find_package(Threads)
  target_link_libraries(${TARGET} ${CMAKE_THREAD_LIBS_INIT})
  
  if(SUBSYSTEM MATCHES GLFW3)
    find_package(PkgConfig REQUIRED)
    pkg_search_module(GLFW REQUIRED glfw3)
    include_directories(${GLFW_INCLUDE_DIRS})
    target_link_libraries(${TARGET} ${GLFW_LIBRARIES})
    target_link_libraries(${TARGET} GL)
    target_link_libraries(${TARGET} X11 Xrandr Xcursor Xi Xxf86vm)
  elseif(SUBSYSTEM MATCHES GLFW2)
    find_package(PkgConfig REQUIRED)
    pkg_search_module(GLFW REQUIRED libglfw)
    include_directories(${GLFW_INCLUDE_DIRS})
    target_link_libraries(${TARGET} ${GLFW_LIBRARIES})
    target_link_libraries(${TARGET} GL)
    target_link_libraries(${TARGET} X11 Xrandr Xcursor Xi Xxf86vm)
  elseif(SUBSYSTEM MATCHES SDL2)
    find_library(SDL2_LIBRARY SDL2 REQUIRED)
    target_link_libraries(${TARGET} ${SDL2_LIBRARY})
  elseif(SUBSYSTEM MATCHES SDL1)
    find_library(SDL1_LIBRARY SDL REQUIRED)
    target_link_libraries(${TARGET} ${SDL1_LIBRARY})
  elseif(SUBSYSTEM MATCHES GLUT)
    
  endif()
endif()<commit_msg>fix #16 -lGL<commit_after>cmake_minimum_required(VERSION 2.8.10)

project(example-2)
set(TARGET example-2)
set(SOURCE main.cxx)

if(NOT SUBSYSTEM)
  set(SUBSYSTEM GLFW3)
endif()

message(" * SUBSYSTEM: ${SUBSYSTEM}")

if(SUBSYSTEM MATCHES GLFW3)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_GLFW3 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES GLFW2)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_GLFW2 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES SDL2)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_SDL2 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES SDL1)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_SDL1 ${CMAKE_CXX_FLAGS}")
elseif(SUBSYSTEM MATCHES GLUT)
  set(CMAKE_CXX_FLAGS "-DWRP_WONDERLAND_SUBSYSTEM_GLUT ${CMAKE_CXX_FLAGS}")
endif()

if(CMAKE_CXX_COMPILER MATCHES "/em\\+\\+(-[a-zA-Z0-9.])?$")

  message(" * C++ compiler: Emscripten")
  
  set(CMAKE_CXX_COMPILER_ID "Emscripten")
  
  #set(CMAKE_CXX_FLAGS "-s ALLOW_MEMORY_GROWTH=1 ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS "-s DISABLE_EXCEPTION_CATCHING=0 ${CMAKE_CXX_FLAGS}")
  
  set(CMAKE_CXX_FLAGS       "-std=c++11 ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS            "-Wall ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS "-pedantic-errors ${CMAKE_CXX_FLAGS}")
  set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
  set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
  
  set(TARGET "${TARGET}.html")

else()

  if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    
    message(" * C++ compiler: Clang")
    
    set(CMAKE_CXX_FLAGS       "-std=c++11 ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS            "-Wall ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS "-pedantic-errors ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -march=native -DNDEBUG")
    set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -march=native -g")
    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -march=native -g")
  
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  
    message(" * C++ compiler: GCC")
    
    set(CMAKE_CXX_FLAGS       "-std=c++11 ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS            "-Wall ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS "-pedantic-errors ${CMAKE_CXX_FLAGS}")
    set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -march=native -DNDEBUG")
    set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -march=native -g -pg")
    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -march=native -g -pg")
    
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
    message(" * C++ compiler: ICC")
  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
    message(" * C++ compiler: MSVC++")
  else()
    message(" * C++ compiler: unknown")
  endif()

endif()

if(CMAKE_BUILD_TYPE MATCHES release)
  message(" * build type: release")
  set(CXX_FLAGS "${CMAKE_CXX_FLAGS}${CMAKE_CXX_FLAGS_RELEASE}")
  message(" * CXX_FLAGS: ${CXX_FLAGS}")
elseif(CMAKE_BUILD_TYPE MATCHES debug)
  message(" * build type: debug")
  set(CXX_FLAGS "${CMAKE_CXX_FLAGS}${CMAKE_CXX_FLAGS_DEBUG}")
  message(" * CXX_FLAGS: ${CXX_FLAGS}")
elseif(CMAKE_BUILD_TYPE MATCHES relwithdebinfo)
  message(" * build type: relwithdebinfo")
  set(CXX_FLAGS "${CMAKE_CXX_FLAGS}${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
  message(" * CXX_FLAGS: ${CXX_FLAGS}")
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../include)

message(" * target: ${TARGET}")
message(" * source: ${SOURCE}")

add_executable(${TARGET} ${SOURCE})
add_dependencies(${TARGET}
  ${CMAKE_CURRENT_SOURCE_DIR}/../../include/wonder_rabbit_project/wonderland.subsystem.hxx
)

if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Emscripten")
  find_package(Threads)
  target_link_libraries(${TARGET} ${CMAKE_THREAD_LIBS_INIT})
  
  if(SUBSYSTEM MATCHES GLFW3)
    find_package(PkgConfig REQUIRED)
    pkg_search_module(GLFW REQUIRED glfw3)
    include_directories(${GLFW_INCLUDE_DIRS})
    target_link_libraries(${TARGET} ${GLFW_LIBRARIES})
    target_link_libraries(${TARGET} GL)
    target_link_libraries(${TARGET} X11 Xrandr Xcursor Xi Xxf86vm)
  elseif(SUBSYSTEM MATCHES GLFW2)
    find_package(PkgConfig REQUIRED)
    pkg_search_module(GLFW REQUIRED libglfw)
    include_directories(${GLFW_INCLUDE_DIRS})
    target_link_libraries(${TARGET} ${GLFW_LIBRARIES})
    target_link_libraries(${TARGET} GL)
    target_link_libraries(${TARGET} X11 Xrandr Xcursor Xi Xxf86vm)
  elseif(SUBSYSTEM MATCHES SDL2)
    find_library(SDL2_LIBRARY SDL2 REQUIRED)
    target_link_libraries(${TARGET} ${SDL2_LIBRARY})
    target_link_libraries(${TARGET} GL)
  elseif(SUBSYSTEM MATCHES SDL1)
    find_library(SDL1_LIBRARY SDL REQUIRED)
    target_link_libraries(${TARGET} ${SDL1_LIBRARY})
  elseif(SUBSYSTEM MATCHES GLUT)
    
  endif()
endif()
{'fraction_non_alphanumeric': 0.1317644507103351, 'fraction_numerical': 0.011495499403535408, 'mean_word_length': 5.1562082777036045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6937691', 'n_tokens_mistral': 3971, 'n_tokens_neox': 3691, 'n_words': 557}