使用统一的编译参数

This commit is contained in:
Xiaofeng Wang 2022-07-26 00:11:31 +08:00
parent 0fc38bbadb
commit ac378eaaf1

View File

@ -36,15 +36,13 @@ foreach(TEST_SRC ${TEST_SRC_LIST})
message(STATUS "add test: ${TEST_EXE_NAME}") message(STATUS "add test: ${TEST_EXE_NAME}")
add_executable(${TEST_EXE_NAME} ${TEST_SRC}) add_executable(${TEST_EXE_NAME} ${TEST_SRC})
target_compile_options(${TEST_EXE_NAME}
PRIVATE ${COMPILE_OPTIONS_DEFAULT})
if(USE_SOLUTION_FOLDERS) if(USE_SOLUTION_FOLDERS)
SET_PROPERTY(TARGET ${TEST_EXE_NAME} PROPERTY FOLDER "test") SET_PROPERTY(TARGET ${TEST_EXE_NAME} PROPERTY FOLDER "test")
endif() endif()
if(MSVC)
set_target_properties(${TEST_EXE_NAME} PROPERTIES COMPILE_FLAGS ${VS_FALGS})
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(${TEST_EXE_NAME} -Wl,--start-group ${MK_LINK_LIBRARIES} -Wl,--end-group) target_link_libraries(${TEST_EXE_NAME} -Wl,--start-group ${MK_LINK_LIBRARIES} -Wl,--end-group)
else() else()