mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 21:44:22 +00:00
Fix unittests compilation for Windows.
This commit is contained in:
parent
d46616e71f
commit
33e3b5c8d0
@ -433,6 +433,12 @@ function(find_unittests dir dependencies)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/third_party/gtest/include)
|
||||
endif()
|
||||
|
||||
# See if the test is linked with "she" library.
|
||||
string(REGEX MATCH "she" link_with_she ${ARGV})
|
||||
if (link_with_she STREQUAL "she")
|
||||
set(extra_definitions -DLINKED_WITH_SHE)
|
||||
endif()
|
||||
|
||||
foreach(testsourcefile ${tests})
|
||||
get_filename_component(testname ${testsourcefile} NAME_WE)
|
||||
|
||||
@ -443,6 +449,11 @@ function(find_unittests dir dependencies)
|
||||
PROPERTIES LINK_FLAGS ${LIBALLEGRO4_LINK_FLAGS})
|
||||
endif()
|
||||
|
||||
if(extra_definitions)
|
||||
set_target_properties(${testname}
|
||||
PROPERTIES COMPILE_FLAGS ${extra_definitions})
|
||||
endif()
|
||||
|
||||
add_custom_target(run_${testname}
|
||||
COMMAND ${testname}
|
||||
DEPENDS ${testname})
|
||||
|
@ -80,9 +80,3 @@ TEST(File, SeveralSizes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
@ -28,7 +28,18 @@
|
||||
#include "ui/gui.h"
|
||||
#endif
|
||||
|
||||
int app_main(int argc, char* argv[])
|
||||
#ifdef LINKED_WITH_SHE
|
||||
#undef main
|
||||
#ifdef WIN32
|
||||
int main(int argc, char* argv[]) {
|
||||
extern int app_main(int argc, char* argv[]);
|
||||
return app_main(argc, argv);
|
||||
}
|
||||
#endif
|
||||
#define main app_main
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int exitcode;
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user