diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ca7991..7a926e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,20 @@ -project(Introspector-generator) +cmake_minimum_required(VERSION 3.8) -set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} /Ob2 /GL /Oi /O2 /permissive-" -) +project(Introspector-generator) -set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} /LTCG" -) +if(MSVC) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} /Ob2 /GL /Oi /O2 /permissive- /std:c++latest" + ) + + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} /LTCG" + ) +elseif(UNIX) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -std=gnu++1z -lstdc++fs -fpermissive" + ) +endif() add_executable(Introspector-generator "src/main.cpp")