mirror of
https://github.com/jorenchik/mdemory.git
synced 2026-03-22 00:26:21 +00:00
Linux un Windows build differences in CMakeLists and appropriate README
This commit is contained in:
@@ -5,10 +5,38 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
set(
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
"${CMAKE_CXX_FLAGS_DEBUG} -g3 -O0 -ggdb -fno-inline"
|
||||
CMAKE_EXPORT_COMPILE_COMMANDS
|
||||
ON CACHE BOOL "Enable generation of compile_commands.json by default"
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
set(
|
||||
WIN32_ADDITIONAL_OPTIONS "-static-libgcc -static-libstdc++ -static"
|
||||
CACHE STRING "Additional options for Windows builds"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(
|
||||
DEFAULT_DEBUG_OPTIONS "-g3 -O0 -ggdb -fno-inline"
|
||||
CACHE STRING "Default debug options"
|
||||
)
|
||||
set(
|
||||
DEFAULT_RELEASE_OPTIONS "-O3 -DNDEBUG"
|
||||
CACHE STRING "Default release options"
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEFAULT_DEBUG_OPTIONS} ${WIN32_ADDITIONAL_OPTIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DEFAULT_RELEASE_OPTIONS} ${WIN32_ADDITIONAL_OPTIONS}")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEFAULT_DEBUG_OPTIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DEFAULT_RELEASE_OPTIONS}")
|
||||
endif()
|
||||
|
||||
option(COMPILE_TESTS "Compile tests" ON)
|
||||
|
||||
add_subdirectory(src/transpiler)
|
||||
add_subdirectory(src/qtapp)
|
||||
add_subdirectory(src/test)
|
||||
if (COMPILE_TESTS)
|
||||
add_subdirectory(src/test)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user