Skip to content

Commit 32120a9

Browse files
committed
CMake: Add C and C++ standard properties per target
Some C libraries didn't like C90 standard
1 parent a1f8fcb commit 32120a9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ if(MSVC)
3434
enable_language(ASM_MASM)
3535
endif()
3636

37-
set(CMAKE_C_STANDARD 90)
38-
set(CMAKE_CXX_STANDARD 11)
39-
4037
# Customizable options
4138
option(BuildPortableVersion "Build portable version (does not read or write files from your user/home directory" ON)
4239
option(BuildMVMP "Whether to create targets for the client (jk2mvmp & jk2mvmenu)" ON)

src/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ if (BuildMVMP)
502502
PRIVATE $<$<CONFIG:Debug>:${DebugDefines}>
503503
PRIVATE $<$<CONFIG:Release>:${ReleaseDefines}>
504504
)
505-
505+
506+
set_target_properties(${MVMP} PROPERTIES CXX_STANDARD 11)
506507
set_target_properties(${MVMP} PROPERTIES INCLUDE_DIRECTORIES "${MVMPIncludeDirs}")
507508
target_link_libraries(${MVMP} ${MVMPLibraries} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${MINIZIP_LIBRARIES} ${ZLIB_LIBRARIES})
508509
set_target_properties(${MVMP} PROPERTIES PROJECT_LABEL "jk2mvmp")
@@ -564,11 +565,12 @@ if (BuildMVDED)
564565
PRIVATE $<$<CONFIG:Debug>:${DebugDefines}>
565566
PRIVATE $<$<CONFIG:Release>:${ReleaseDefines}>
566567
)
567-
568+
569+
set_target_properties(${MVDED} PROPERTIES CXX_STANDARD 11)
568570
set_target_properties(${MVDED} PROPERTIES INCLUDE_DIRECTORIES "${MVDEDIncludeDirs}")
569571
target_link_libraries(${MVDED} ${MVDEDLibraries} ${MINIZIP_LIBRARIES} ${ZLIB_LIBRARIES})
570572
set_target_properties(${MVDED} PROPERTIES PROJECT_LABEL "jk2mvded")
571-
573+
572574
# installation
573575
if(WIN32 OR APPLE)
574576
install(TARGETS ${MVDED} RUNTIME DESTINATION ".")

src/menu/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ target_compile_definitions(${MVMENU}
3939
PRIVATE $<$<CONFIG:Release>:${ReleaseDefines}>
4040
)
4141

42+
set_target_properties(${MVMENU} PROPERTIES C_STANDARD 90)
4243
set_target_properties(${MVMENU} PROPERTIES INCLUDE_DIRECTORIES "${MVMENUIncludeDirs}")
4344
set_target_properties(${MVMENU} PROPERTIES PROJECT_LABEL "jk2mvmenu")
4445

0 commit comments

Comments
 (0)