ifdef without define - code example I don't understand

I'm using this code from 2dom on github for use on my RGB matrix display - LINK

I'll insert it below for convenience. I see it can be used for either ESP8266 or ESP32, and there are sections of code that run for each option enclosed by #ifdef and #endif.

However there does not seem to be a #define anywhere in the sketch, e.g "#define ESP32" in my case.
Is that correct? Could anyone explain please.

#include <PxMatrix.h>


#ifdef ESP32

#define P_LAT 22
#define P_A 19
#define P_B 23
#define P_C 18
#define P_D 5
#define P_E 15
#define P_OE 2
hw_timer_t * timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;

#endif

#ifdef ESP8266

#include <Ticker.h>
Ticker display_ticker;
#define P_LAT 16
#define P_A 5
#define P_B 4
#define P_C 15
#define P_D 12
#define P_E 0
#define P_OE 2

#endif
// Pins for LED MATRIX

PxMATRIX display(32,16,P_LAT, P_OE,P_A,P_B,P_C);
//PxMATRIX display(64,32,P_LAT, P_OE,P_A,P_B,P_C,P_D);
//PxMATRIX display(64,64,P_LAT, P_OE,P_A,P_B,P_C,P_D,P_E);

#ifdef ESP8266
// ISR for display refresh
void display_updater()
{
  display.displayTestPattern(70);
  // display.displayTestPixel(70);
  //display.display(70);
}
#endif

#ifdef ESP32
void IRAM_ATTR display_updater(){
  // Increment the counter and set the time of ISR
  portENTER_CRITICAL_ISR(&timerMux);
  //isplay.display(70);
  display.displayTestPattern(70);
  portEXIT_CRITICAL_ISR(&timerMux);
}
#endif


uint16_t myCYAN = display.color565(0, 255, 255);
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
  display.begin(4);
  display.flushDisplay();
  display.setTextColor(myCYAN);
  display.setCursor(2,0);
  display.print("Pixel");
  Serial.println("hello");

  #ifdef ESP8266
    display_ticker.attach(0.002, display_updater);
  #endif

  #ifdef ESP32
    timer = timerBegin(0, 80, true);
    timerAttachInterrupt(timer, &display_updater, true);
    timerAlarmWrite(timer, 2000, true);
    timerAlarmEnable(timer);
  #endif

  delay(1000);
}


void loop() {

 delay(100);

}

Do you see a "-DESP32" in the compiler command line?

Not specifically that, it shows the following in Arduino IDE, I will try with verbose enabled:

Sketch uses 660798 bytes (50%) of program storage space. Maximum is 1310720 bytes.
Global variables use 52176 bytes (15%) of dynamic memory, leaving 275504 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM10
Connecting........__
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 3c:71:bf:60:63:f0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 6553.6 kbit/s)...
Hash of data verified.
Compressed 17392 bytes to 11186...

Writing at 0x00001000... (100 %)
Wrote 17392 bytes (11186 compressed) at 0x00001000 in 0.1 seconds (effective 1023.1 kbit/s)...
Hash of data verified.
Compressed 660912 bytes to 396883...

Writing at 0x00010000... (4 %)
Writing at 0x00014000... (8 %)
Writing at 0x00018000... (12 %)
Writing at 0x0001c000... (16 %)
Writing at 0x00020000... (20 %)
Writing at 0x00024000... (24 %)
Writing at 0x00028000... (28 %)
Writing at 0x0002c000... (32 %)
Writing at 0x00030000... (36 %)
Writing at 0x00034000... (40 %)
Writing at 0x00038000... (44 %)
Writing at 0x0003c000... (48 %)
Writing at 0x00040000... (52 %)
Writing at 0x00044000... (56 %)
Writing at 0x00048000... (60 %)
Writing at 0x0004c000... (64 %)
Writing at 0x00050000... (68 %)
Writing at 0x00054000... (72 %)
Writing at 0x00058000... (76 %)
Writing at 0x0005c000... (80 %)
Writing at 0x00060000... (84 %)
Writing at 0x00064000... (88 %)
Writing at 0x00068000... (92 %)
Writing at 0x0006c000... (96 %)
Writing at 0x00070000... (100 %)
Wrote 660912 bytes (396883 compressed) at 0x00010000 in 5.8 seconds (effective 917.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 2234.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Ah so I can see "-DESP32" now in the verbose compile text:

- -DF_CPU=240000000L -DARDUINO=10810 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 "-I

So it is being determined at compile time by the selected board?

Correct, this is what does it:

build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.defines}

...

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

Great thanks for all the info!