-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
35 lines (29 loc) · 941 Bytes
/
CMakeLists.txt
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
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.12)
project(EternalResourceExtractor)
set(CMAKE_CXX_STANDARD 17)
file(GLOB SOURCES
./main.cpp
./extract.cpp
./extract.hpp
./utils.cpp
./utils.hpp
./ooz.hpp
./mmap/mmap.cpp
./mmap/mmap.hpp
./argh/argh.hpp
)
if (MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_FLAGS "/O2 /Oi /Ot /GL /EHsc")
else()
set (CMAKE_CXX_FLAGS "-Ofast -DNDEBUG -s")
endif()
add_executable(EternalResourceExtractor ${SOURCES})
if(MSVC)
target_link_options(EternalResourceExtractor PUBLIC "/LTCG")
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(EternalResourceExtractor ${CMAKE_SOURCE_DIR}/lib/ooz.lib)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(EternalResourceExtractor ${CMAKE_DL_LIBS} ${CMAKE_SOURCE_DIR}/lib/libooz.a)
endif()